Definite Integrals – Evaluating the Given Complex Integral

calculusdefinite integralsintegrationtrigonometry

So I have a younger friend of mine (who I've mentioned before) who loves math, especially when it comes to integrals, and will sometimes give me (somewhat) abominations of integrals which I'm usually able to evaluate. Last night, this friend of mine gave me this integral to evaluate:

$$\int_0^1(x+2i\sqrt{x\tan(x)})(x-2i\sqrt{x\tan(x)})\cos(x)-2\cos(x)dx$$

which I felt that maybe I might be able to do. Here is my attempt at doing so:

$$\begin{align*}
& \int_0^1(x+2i\sqrt{x\tan(x)})(x-2i\sqrt{x\tan(x)})\cos(x)-2\cos(x)dx \\
&= \int_0^1(x^2+2ix\sqrt{x\tan(x)}-2ix\sqrt{x\tan(x)}+4x\tan(x))\cos(x)-2\cos(x)dx\\
&= \int_0^1(x^2+4x\tan(x))\cos(x)-2\cos(x)dx \\
&= \int_0^1x^2\cos(x)+4x\sin(x)-2\cos(x)dx \\
&= \int_0^1x^2\cos(x)dx+2x\sin(x)+2x\sin(x)-2\cos(x)dx \\
&= \int_0^1\dfrac d{dx}\left(x^2\cos(x)+2x\sin(x)\right)dx \\
&= \left[x^2\cos(x)+2x\sin(x)\right]_0^1\\
&=\cos(1)+2\sin(1)
\end{align*}$$


My question


Did I evaluate the definite integral that my friend gave me correctly, or what would I do to evaluate it?

Best Answer

You could simply use the difference of squares formula to go from the first to the third step in one stride. Also, the way you wrote the integrand as a derivative is incorrect. Try differentiating to check. To get the indefinite integral, all you need to do is integrate by parts - integrating the trig function and differentiating the polynomial coefficient. So, $\int x^2\cos xdx=(x^2-2)\sin x+2x\cos x$ and $\int x\sin xdx=\sin x-x\cos x$. So, the answer is actually $-\sin(1)+2\cos(1)+4\sin(1)-4\cos(1)-2\sin(1)=\sin(1)-2\cos(1)$