Can I blindly trust WolframAlpha?

272 Views Asked by At

Recently, my friend gave me the following indefinite integral to evaluate : $$\int \frac{\sin^2 x }{\sin x +\cos x} \mathrm dx$$

I searched it on WolframAlpha, just to be sure, that whether it has an elementary primitive or not. It turn out to be not a elementary one.

enter image description here

Then I asked him, that why did he gave it to me, if it wasn't supposed to be a question for High-schoolers? His reply surprised me! He had solved it. It goes as follows -

\begin{align}\int \frac{\sin^2 x }{\sin x +\cos x}\mathrm dx &=\int \frac 12 \left( \frac{\sin^2 x +\color{blue}{\cos^2 x}}{\sin x +\cos x} + \frac{\sin^2 x -\color{blue}{\cos^2 x}}{\sin x +\cos x} \right)\mathrm dx \\ &=\frac 12 \int \frac{1}{\sin x +\cos x}\mathrm dx +\frac 12 \int (\sin x -\cos x)\mathrm dx\\ \end{align}

Now the first part can be solved using $\sin x +\cos x = \sqrt 2 \cos \left( x -\dfrac {\pi}4 \right)$ and $\int \sec x \mathrm dx = \ln (\sec x+ \tan x )$. Second part is trivial.

Did I get something wrong, or Wolfy is the wrong one here?

1

There are 1 best solutions below

0
On BEST ANSWER

Wolfram Alpha did a perfect job, as usual.

Looking just below the answer, there is a plot clearly showing that the complex version is considered.

And looking a little more below, alternate forms are given, the first of which doesn't have the complex constants.

If you worry about the hyperbolic function, you have to know that WA's answer and yours are equivalent, and the reference to a well-known function is probably a good idea.