Integrating function defined in terms of itself Here's the question I am trying to solve:

The variables $x$ and $y$ satisfy the differential equation
  $$\frac{\mathrm{d}y}{\mathrm{d}x} = 4\cos^2{y}\tan{x}.$$
  for $0 \leq x < \frac{1}{2}\pi$, and $x = 0$ when $y = \frac{1}{4}\pi$. Solve this differential equation and find the value of $x$ when $y = \frac{1}{3}\pi$.

The answer (from the book) is:

$\tan{y} = 4\ln{\sec{x}} + 1$

I started by integrating both sides, to give
$$y = \int{4\cos^2{y}\tan{x}\:\mathrm{d}x}.$$
But here I am stuck. I have no idea how to get rid of the $y$ in $4\cos^2{y}\tan{x}$. Normally with questions which have a $y$ on both sides, I can manipulate it into the form of
$$\int{\frac{y\prime}{y}\:\mathrm{d}x} = \int{u}$$
which then simplifies to
$$\ln{\left|y\right|} = \int{u}.$$
For this question I don't see how I can do this, as the $y$ is wrapped in a $\cos$ and a $a \to a ^ 2$.
 A: What if you instead divide both sides by $ \cos^2 y $ (assume this is nonzero), producing
$$ \frac{1}{\cos^2y} \, \frac{dy}{dx} = 4 \tan x $$
and integrate both sides? You will then have to compute two integrals, one for each side of the equation:
$$ \int \frac{1}{\cos^2 y} \, dy = \int 4 \tan x \, dx. $$
Remember to include a constant (only one is needed), say $ C $, after integrating and use the initial conditions to find the value of $C$.
This is an example of a separable differential equation, where the general method is to isolate all the $x$s and $y$s to different sides and integrate.
A: $$\frac{dy}{dx}=4\cos^2(y)\tan(x)$$
so:
$$\sec^2(y)\frac{dy}{dx}=4\tan(x)$$
now integrate both sides:
$$\int\sec^2(y)\frac{dy}{dx}dx=4\int\tan(x)dx$$
$$\to$$
$$\int\sec^2(y)dy=4\int\tan(x)dx$$
$$\tan(y)=\ln|\sec(x)|+C$$
and we know that when $x=0$,$y=\frac{\pi}{4}$
so:
$$\tan\left(\frac{\pi}{4}\right)=\ln(\sec(0))+C$$
$$1=0+C \therefore C=1$$
input this and we get:
$$\tan(y)=\ln|\sec(x)|+1$$
A: $$f'(x)=a\cos^2(f(x))\tan(x)$$
$$\frac{f'(x)}{\cos^2(f(x))}=a\tan x$$
$$\int\frac{f'(x)}{\cos^2(f(x))}dx=a\int\tan(x)dx$$
$$\int\frac{f'(x)}{\cos^2(f(x))}dx=c_1-a\ln|\cos x|$$
Let $y=f(x)$. Therefore $dy=f'(x)dx$. Which gives
$$\int\frac{dy}{\cos^2(y)}=c_1-a\ln|\cos x|$$
$$\int\sec^2y\,dy=c_1-a\ln|\cos x|$$
$$\tan y=c_1-a\ln|\cos x|$$
$$\tan f(x)=c_1-a\ln|\cos x|$$
Therefore
$$f(x)=\arctan(c_1-a\ln|\cos x|)$$
