# Can't seem to find the correct methods to integrate $\int \frac{x³}{x⁴+x²+1}dx$ and $\ \int \frac{dx}{\sin(2x)\ln(\tan(x))}$

I need help solving these integrals, I failed my calculus exam anyways but I'd like to understand how to solve these. Any help would be much appreciated.

For the first integral: $\displaystyle\int \frac{x^3}{x^4+x^2+1}dx$,

At first I thought I could solve it by partial fractions but then I realized that the denominator has no factors (at least not real numbers). So I thought of completing the square for the denominator and I got something like this: $$\int \frac{x^3}{(x^2+\frac{1}{2})^2 - \frac{3}{4}} dx$$

At thiss point I tried to solve it by using the integration by parts method considering $\displaystyle u = x^3$ and $\displaystyle dv = \frac{dx}{(x^2+\frac{1}{2})^2 - \frac{3}{4}}$, and then I realized that I complicated the expression too much instead of simplifying it.

For the second integral $$\int\frac{dx}{\sin(2x)\ln(\tan(x))}$$ I got as far as replacing it with something like this $$\int \frac{dx}{2\sin(x)\cos(x)\ln\left(\frac{\sin(x)}{\cos(x)}\right)}$$, and then, $$\frac{1}{2}\int\frac{dx}{\sin(x)\cos(x)\ln(\sin(x)-\cos(x))}$$. Up to this point I couldn't think of anything else to do :(.

I'd like to get some pointers on what did I do wrong, and what methods I should've used. Also, any integral calculus (or even algebra or trigonometry) book recommendations would be very welcome.

P.S. Sorry for my English (It's not my native tongue).

• For the first integral, try $u = x^2 + 1/2$. This integral looks very much like an arctan integral and, having noticed that, it should be clear to move forward with a trig substitution. – Kaynex May 13 '17 at 23:23
• Please remove on of the to questions (one of the two integrals). We welcome a post with a question, not those with "questionS" – amWhy May 13 '17 at 23:23
• On that 2nd integral what about trying a substitution, say $u=ln(tan(x))$ – sharding4 May 13 '17 at 23:31
• @amWhy Hello. what do you think about my result. The OP used $x^3=t$ which doesn't work here. – hamam_Abdallah May 13 '17 at 23:44
• @Salahamam_Fatima I just answered, via vote. – amWhy May 13 '17 at 23:51

## 3 Answers

Put $$x^2=t,\; \;2x^3dx=t\,dt$$

the integral becomes

$$\frac 12 \int \frac {t\,dt}{t^2+t+1}$$

$$=\frac {1}{4}\int \frac {2t+1-1}{t^2+t+1}\, dt$$

$$=\frac 14 \left(\int \frac {2t+1}{t^2+t+1}\,dt-\int \frac {dt}{t^2+t+1}\right)$$

$$\frac 14\ln (t^2+t+1)-\frac {1}{2\sqrt {3}}\arctan \left( \frac {2t+1}{\sqrt {3}} \right)+C$$

$$=\frac 14\ln (x^4+x^2+1)-\frac {1}{2\sqrt {3}}\arctan\left(\frac {2x^2+1}{\sqrt {3}} \right)+C$$

• Proposing t = x^2 was the way to go :). I had a bit of problems understanding how did you go from tdt to 2t+1-1 but then it hit me that you were trying to give it the form of the derivative of the denominator and the splitting the integral in two where I can give it the form of dt/t and the second one as an arctan integral. Took me a while but I finally figured it out. Thanks! – Rob May 14 '17 at 1:27

For the integral $$\int\frac{1}{\sin(2x)\ln(\tan(x))}dx$$ you can put $$t=\ln(\tan(x))\implies dt=\frac{\sec^2(x)}{\tan(x)}dx=\frac{1}{\sin(x)\cos(x)}dx=\frac{2}{\sin(2x)}dx$$ so $$\int\frac{1}{\sin(2x)\ln(\tan(x))}dx=\frac{1}{2}\int\frac{1}{t}dt$$ Now it's easy to solve.

• @Salahamam Ixion is answering the second of the asker's questions. – amWhy May 13 '17 at 23:53
• @Ixion Indeed it simplifies a lot, it was more trigonometry than calculus, I guess I'll have to focus on my trigonometry. Thanks! Any tips on how to identify the correct substitutions or the right trigonometric identities?, I mean, it took me 7 steps to go from sec^2(x) / tan(x) to 1 / (sin(x)cos(x)). – Rob May 14 '17 at 1:20
• @Rob $\sec^2(x)=\frac{1}{\cos^2(x)}$ and $\tan(x)=\frac{\sin(x)}{\cos(x)}$ so $$\frac{\sec^2(x)}{\tan(x)}=\frac{1}{\cos^2(x)\cdot\frac{\sin(x)}{\cos(x)}}=\frac{1}{\cos(x)\sin(x)}$$. :) – Ixion May 14 '17 at 1:28
• Oh I see, what I did was more complicated but eventually got to the same result. I used first: $sec^2(x) = 1 + tan^2(x)$ and the you probably know the rest: $\frac{1}{tan(x)} + \frac{tan^2(x)}{tan(x)}$ ... – Rob May 14 '17 at 1:37

Notice that $$x^4+x^2+1=(x^4+x^2+1+x^2)-x^2=(x^2+1)^2-x^2=(x^2+x+1)(x^2-x+1)$$

So using partial fractions, $$\dfrac{x^3}{x^4+x^2+1}$$ can be expressed in the form

$$\frac{Ax+B}{x^2+x+1}+\frac{Cx+D}{x^2-x+1}$$

This means that $$(Ax+B)(x^2-x+1)+(Cx+D)(x^2+x+1)=x^3$$.

Hence, $$A+C=1,\;B+D=0,\;B-A+C+D=0,\;A-B+C+D=0$$

Solving this, we get $$A=B=C=\dfrac{1}{2},\;D=-\dfrac{1}{2}$$

Therefore, $$\frac{x^3}{x^4+x^2+1}=\frac{1}{2}(\frac{x+1}{x^2+x+1}+\frac{x-1}{x^2-x+1})$$

Now we compute the integral $$\int \frac{x+1}{x^2+x+1}dx$$

By completing the square in the denominator, we can transform the expression inside the integral into $$\frac{x+1}{(x+\frac{1}{2})^2+\frac{3}{4}}$$

This is the same as

$$\dfrac{x+\dfrac{1}{2}}{(x+\dfrac{1}{2})^2+\dfrac{3}{4}}+\dfrac{1}{2}\frac{1}{(x+\dfrac{1}{2})^2+\dfrac{3}{4}}=\dfrac{4}{3}\dfrac{x+\dfrac{1}{2}}{1+\dfrac{4}{3}(x+\dfrac{1}{2})^2}+\dfrac{1}{2}\dfrac{1}{1+\dfrac{4}{3}(x+\dfrac{1}{2})^2}$$

If we substitute $$v=\dfrac{2}{\sqrt{3}}(x+\dfrac{1}{2})$$, then we get

$$\int \frac{x+1}{x^2+x+1}dx=\frac{4}{3}\int \frac{v}{1+v^2}+\frac{2}{3}\frac{\sqrt{3}}{2} \int \frac{1}{1+v^2}$$

This is equal to $$\dfrac{2}{3} ln(1+v^2)+\dfrac{1}{\sqrt{3}}tan^{-1}(v)$$

Now, we compute

$$\int \frac{x-1}{x^2-x+1}dx$$

Let $$u=\dfrac{2}{\sqrt{3}}(x-\dfrac{1}{2})$$, then the integral becomes

$$\int (\dfrac{4}{3}\dfrac{u}{1+u^2}-\dfrac{1}{\sqrt{3}}\dfrac{1}{1+u^2})du$$

which is equal to

$$\dfrac{2}{3} ln(1+u^2)-\dfrac{1}{\sqrt{3}}tan^{-1}(u)$$

If we write u and v in terms of x again and add the two results we obtained together, we get

$$\dfrac{2}{3} ln(\frac{4}{3}-\frac{4}{3}x+\frac{4}{3}x^2)-\dfrac{1}{\sqrt{3}}tan^{-1}(\dfrac{2}{\sqrt{3}}(x-\dfrac{1}{2}))+\dfrac{2}{3} ln(\frac{4}{3}+\frac{4}{3}x+\frac{4}{3}x^2)+\dfrac{1}{\sqrt{3}}tan^{-1}(\dfrac{2}{\sqrt{3}}(x+\dfrac{1}{2}))$$

Hence, the integral $$\int \frac{x^3}{x^4+x^2+1}dx$$ is equal to

$$\dfrac{1}{3} ln(\frac{4}{3}-\frac{4}{3}x+\frac{4}{3}x^2)-\dfrac{1}{2\sqrt{3}}tan^{-1}(\dfrac{2}{\sqrt{3}}x-\dfrac{1}{\sqrt{3}})+\dfrac{1}{3} ln(\frac{4}{3}+\frac{4}{3}x+\frac{4}{3}x^2)+\dfrac{1}{2\sqrt{3}}tan^{-1}(\dfrac{2}{\sqrt{3}}x+\dfrac{1}{\sqrt{3}})$$

plus some arbitrary constant, of course.