# Thread: integral of 2xsinx/cosx dx

1. ## integral of 2xsinx/cosx dx

Hi,

$\int\frac{cosx-2xsinx}{cosx}dx=\int\frac{cosx}{cosx}dx - \int\frac{2xsinx}{cosx}dx$

How would one tackle the above problem? The numerator in the second term looks like an integration by parts but how is that handled with the denominator? A clue would be good for me to get started.
I have tried substitution but the x in the numerator gets in the way of du etc.

Thanks
bugatti79

2. Are you sure that's the integrand? Mathematica gives

$x\,\left( 1 - i \,x + 2\,\ln (1 + e^{2\,i \,x}) \right) - i \,\text{PolyLog}(2,-e^{2\,i \,x}).$

I wouldn't expect polylogs to show up in a regular calculus class. Or is this advanced calculus?

3. The only pratical way to integrate the function $x\ \tan x$ is to start from the series expansion...

$\displaystyle \tan x = x + \frac{x^{3}}{3} + \frac{2\ x^{5}}{15} + \dots + \frac{2^{2n}\ (2^{2n}-1)\ B_{n}\ x^{2n-1}}{(2n)!} + \dots$ (1)

... where $B_{n}$ is the Bernoulli number of order n, multiply by x and then integrate 'term by term' obtaining...

$\displaystyle \int x\ \tan x\ dx = \frac{x^{3}}{3} + \frac{x^{5}}{15} + \dots + \frac{2^{2n}\ (2^{2n}-1)\ B_{n}\ x^{2n+1}}{(2n+1)!} + \dots + c$ (2)

Kind regards

$\chi$ $\sigma$

4. ## integral of 2xsinx/cosx dx

Hi all,
No its just regular calculus. I am actually looking at solving a linear differential equation of first oder..

dy/dx -ytanx = cosx-2xsinx. I belive this is of the form dy/dx+Py=Q where P and Q are functions of x hence one could use the integrating factor method
$e^\int{P}dx$.
I think I have made an error with the signs....probably why I arrived at a difficult integral.
I will look at it again and keep you posted. Thanks for your interest.
bugatti

5. Using Integration by Parts with $u = x$ and $dv = \tan{x}$ gives $du = 1$ and $v = -\ln{|\cos{x}|}$...

So $\int{x\tan{x}\,dx} = -x\ln{|\cos{x}|} - \int{-\ln{|\cos{x}|}\,dx}$

$= -x\ln{|\cos{x}|} + \int{\ln{|\cos{x}|}\,dx}$

And then, like has been said above, the new integral involves Polylogarithms.

6. Originally Posted by bugatti79
Hi all,
No its just regular calculus. I am actually looking at solving a linear differential equation of first oder..

dy/dx -ytanx = cosx-2xsinx. I belive this is of the form dy/dx+Py=Q where P and Q are functions of x hence one could use the integrating factor method
$e^\int{P}dx$.
I think I have made an error with the signs....probably why I arrived at a difficult integral.
I will look at it again and keep you posted. Thanks for your interest.
bugatti
$\int (- \tan x) \, dx = \ln (\cos x)$ where the arbitrary constant is ignored for obvious reasons. So there are several ways that you might have made an error in signs in your attempt to get the integrating factor.

7. Originally Posted by mr fantastic
$\int (- \tan x) \, dx = \ln (\cos x)$ where the arbitrary constant is ignored for obvious reasons. So there are several ways that you might have made an error in signs in your attempt to get the integrating factor.
Yes, it appears that the OP has found the integrating factor to be

$e^{\int{\tan{x}\,dx}} = e^{-\ln{(\cos{x})}} = e^{\ln{(\cos{x})^{-1}}} = \frac{1}{\cos{x}}$

when it should be

$e^{\int{-\tan{x}\,dx}} = e^{\ln{(\cos{x})}} = \cos{x}$.

The multiplication through by the integrating factor should result in

$\frac{d}{dx}(y\cos{x}) = \cos^2{x} - 2x\sin{x}\cos{x}$

$\frac{d}{dx}(y\cos{x}) = \frac{1}{2} + \frac{1}{2}\cos{2x} - x\sin{2x}$

which is now easily solvable (keeping in mind that the third term needs integration by parts).

8. ## integral of 2xsinx/cosx dx

hi all,

yes, that was the mistake i made, therefore i calculate

$ycosx=\frac{1}{2}x(1+cos2x)+c$ which can be further tidied up.

bugatti79

9. No, it's actually

$y\cos{x} = \frac{1}{2}x + \frac{1}{4}\sin{2x} - (-\frac{1}{2}x\cos{x} - \int{-\cos{2x}\,dx})$

$y\cos{x} = \frac{1}{2}x + \frac{1}{4}\sin{2x} + \frac{1}{2}x\cos{x} - \int{\cos{2x}\,dx}$

$y\cos{x} = \frac{1}{2}x + \frac{1}{4}\sin{2x} + \frac{1}{2}x\cos{x} - \frac{1}{2}\sin{2x} + C$

$y\cos{x} = \frac{1}{2}x - \frac{1}{4}\sin{2x} + \frac{1}{2}x\cos{x} + C$.