# How to find $\int \frac {(1+x^2)(2+x^2)}{(x \cos x+\sin x)^4}dx$?

I came across this integral while studying indefinite integrals.

So far I have had many unsuccessful attempts which include - trying by parts - but I could not find a way to proceed with it.

I even tried dividing both numerator and denominator by $$x^4$$ to yield $$\int \frac {(1+x^{-2})(1+2x^{-2})}{( \cos x+ \frac \sin x)^4}dx.$$ But I am still not able to move forward.

I even tried to cheat a little bit by taking derivative of options, still nothing.

And many more..

So the problem still stands. Can someone tell me how to proceed?

(Note: this is a problem from very elementary calculus course so no contour integrals, no multivariable and such stuff, however I think differentiation under integration would be fine. Also it would help if answers are one of those present in options (see image).)

Edit: Thanks to comments now I know answer is C but I was wondering if anyone could show me a straightforward way to do it thanks! Edit 2 : turns out B is also correct.

• Try derivatives of each option. If needed, plot to see which is off by vertical shift from starting integrand. Apr 5 '20 at 2:51
• As coffeemath has suggested, try taking the derivatives of each option. Instead of doing that manually, there are online resources to help, with WolframAlpha being a common one which is used. However, one interesting thing I've noticed, which might help but I'm not sure as I didn't follow through on it on checking it further, is that if $f(x) = x\sin x$, then $f'(x) = x\cos x + \sin x$. Apr 5 '20 at 2:55
• @John Omielan Thanks! Now I know answer is C. Apr 5 '20 at 3:02
• @coffeemath thanks! I know the answer now. Apr 5 '20 at 3:08

Let $$f_n(x) = \left( \frac {\cos x - x \sin x}{x\cos x + \sin x} \right)^n$$ and note that,

$$\frac{df_n(x)}{dx} = -\frac{n(\cos x - x \sin x)^{n-1}(x^2+2)}{(x\cos x + \sin x)^{n+1}}$$

Then, for $$n=1$$ and $$n=3$$, we have respectively, $$\frac{df_1(x)}{dx} = -\frac{x^2+2}{(x\cos x + \sin x)^{2}}$$ $$\frac{df_3(x)}{dx}=- \frac{3(\cos x - x \sin x)^2(x^2+2)}{(x\cos x + \sin x)^{4}}$$

$$\frac {(1+x^2)(2+x^2)}{(x \cos x+\sin x)^4} = -\frac{d}{dx}\left(\frac13f_3(x)+f_1(x)\right)$$

Thus,

\begin{align} & \int \frac {(1+x^2)(2+x^2)}{(x \cos x+\sin x)^4}dx \\ & =-\frac13f_3(x)-f_1(x) \\ & =-\frac13 \left( \frac {\cos x - x \sin x}{x\cos x + \sin x} \right)^3 - \frac {\cos x - x \sin x}{x\cos x + \sin x} \\ & =-\frac13 \left( \frac {1- x \tan x}{x + \tan x} \right)^3 - \frac {1- x \tan x}{x + \tan x} + C\\ \end{align}

• Wow! That was amazing. Can I ask how did you came up with the fact that this $$f_n(x) = \left( \frac {\cos x - x \sin x}{x\cos x + \sin x} \right)^n$$ might help? Apr 5 '20 at 4:12
• @HrishabhNayal - I knew about this general expression; I have seen it. It helps produce high inverse power Apr 5 '20 at 4:18
• @Quanto !Very nice indeed! Apr 5 '20 at 4:50

Let $$I=\int\frac{(1+x^2)(2+x^2)}{(x\sin x+\cos x)^4}dx$$

We can write $$x\sin x+\cos x=\sqrt{1+x^2}\cos(x-\alpha)$$

Where $$\displaystyle \sin \alpha=\frac{x}{\sqrt{x^2+1}}$$ and $$\displaystyle \cos \alpha=\frac{1}{\sqrt{x^2+1}}$$ and $$\tan \alpha=x\Rightarrow \alpha=\tan^{-1}(x)$$

So $$I =\int\frac{2+x^2}{1+x^2}\sec^4(x-\tan^{-1}(x))dx$$

• Is that a hint? If so I am unable to follow it to answer can you elaborate further? Apr 5 '20 at 3:36
• Hey! I got it now. Thanks! Now I kniw B is also correct. :) Apr 5 '20 at 7:15