# Integrating a tan function

1. Mar 29, 2012

### _alexis_

Hello.

I was trying to solve Lagrangian equation and I manage to reduce second order differential equation that I got:

$\ddot{\varphi}$+$\alpha$$\frac{tan\varphi}{cos^{2}\varphi}$=0;

where $\alpha$ is a constant,

to first order differential equation:

$\dot{\varphi}^{2}$+ $\alpha$$tan^{2}\varphi$ -C=0;

where C is integration constant and from starting conditions I calculated it to be:
C= 8$\alpha$.

Now all I have left is this integral to solve:

$\int$ $\frac{d\varphi}{\sqrt{8-tan^{2}\varphi}}$

But I can't find the right substitution.

I did try using some trigonometric identities to make this integral easier to solve or familiar but I didn't manage to get anywhere with it.

2. Mar 29, 2012

### MathematicalPhysicist

The integral you want to calculate is $\int\frac{d\phi}{\sqrt{1-tan^2(\phi)}}$ (obviously your integral we can factor out the 8 by suitable change of variables.

so use the fact that 1-tan^2(phi)= (cos^2()-sin^2())/cos^2()=cos(2phi)/cos^2()
after taking the sqrt and reciprocal you get:
cos(phi)dphi/sqrt(cos(2 phi)) = sqrt((cos(2 phi)+1)/(2cos(2 phi))) dphi
Now put cos(2 phi) = t to get an integral of the form (without the right factors obviously :-)):

-sqrt((t+1)/t) sqrt(1/(1-t^2) dt = sqrt(1/(t(1-t)) dt = sqrt(1/(-(t-1/2)^2+1/4)) dt

and that's look like a nice integral of the form:
ds/sqrt(1-s^2)

which its integral is?

3. Mar 30, 2012

### _alexis_

I tried substituting $\frac{tan\varphi}{\sqrt{8}}$=tan$\theta$ but I didn't get desired result because I got this:
d$\varphi$=$\frac{\sqrt{8}}{1-4cos^{2}\theta}$d$\theta$