Shortcut for value of $f(1)$ where $f(x) = \int e^x \left(\arctan x + \frac {2x}{(1+x^2)^2}\right)\,dx$ If $$f(x) = \int e^x \biggr(\arctan x + \frac {2x}{(1+x^2)^2}\biggr)\,dx$$ and $f(0)=0$ then value of $f(1)$ is? 
This is actually a Joint Entrance Examination question so I have to do it in two minutes. Is there a shortcut to finding this result quickly? It seems very complicated. The answer is $e(\pi/4-(1/2)). $
 A: With $g(t) = \arctan(t) = \tan^{-1}(t)$, the function is $$f(x) = \int_0^x e^t (g(t) - g''(t))  \, dt = \int_0^x [e^t g(t)]' - [e^t g'(t)]'\, dt = $$ $$ = \int_0^x [e^t(g(t) - g'(t)]' \, dt = 
e^x(g(x) - g'(x)) - (g(0) - g'(0))$$
As noted in comments,  $f(1)$ is actually $\frac{e\pi}{4} - \frac{e}{2} +1$.
A: Actually there is a formula $$\int e^x (g (x)+g'(x))\,dx = e^x\cdot g (x)+c.$$
Now for $$\int e^x \biggr(\arctan x + \frac {2x}{(1+x^2)^2}\biggr)\,dx $$, do the following manipulation:
 $$\int e^x \biggr(\arctan x + \frac {2x}{(1+x^2)^2}\biggr)\,dx =\int e^x \biggr(\arctan x - \frac {1}{1+x^2}+\frac {1}{1+x^2}+\frac {2x}{(1+x^2)^2}\biggr)\,dx. $$
Note that $$\biggr(\arctan x - \frac {1}{1+x^2}\biggr)'=\frac {1}{1+x^2}+\frac {2x}{(1+x^2)^2}. $$
Then by the above formula  $$\int e^x \biggr(\arctan x + \frac {2x}{(1+x^2)^2}\biggr)\,dx=e^x \biggr(\arctan x - \frac {1}{1+x^2}\biggr)+c.$$
So $$f (1)=\biggr[e^x \biggr(\arctan x - \frac {1}{1+x^2}\biggr)\biggr]_0^1=\frac {e\pi}{4}-\frac {e}{2}+1. $$
A: Use the result $$\int e^x\left(g(x)+g'(x)\right)dx=e^xg(x)+c$$ to prove that
$$\int e^x\left(g'(x)-g''(x)\right)dx=e^x\left(g(x)-g'(x)\right)+c$$
Put $g(x)=\arctan x$ to obtain $g'(x)=\frac{1}{1+x^2}$ and then $g''(x)=-\frac{2x}{(1+x^2)^2}$
and we are done
