# Simple Integral

$$\int \tan x \cdot dx + \int \tan 2y \cdot dy = 0$$

I get

$$1 = C\sqrt{\cos 2y} \cos x$$

My init conditions were y(0) = pi/2 so I end up getting C as $\sqrt{-1}$ but the equation should be

$$-1 = \cos 2y \cos^2 x$$

Where's my error?

HallsofIvy
Homework Helper
Did you forget that $\int \frac{du}{u}= ln |u|+ C$?

That is, did you forget the absolute value?

HallsofIvy said:
Did you forget that $\int \frac{du}{u}= ln |u|+ C$?

That is, did you forget the absolute value?

Wouldn't I then have to add absolute signs around both cosines? Then C would equal 1 instead of -1.

I'm not sure where 1/u comes up... can't I just integrate tan x to get -ln |cos x| and tan 2y to get -1/2 ln |cos 2y|?

HallsofIvy
Homework Helper
Yes, but the "1/u" is where ln|cos x| comes from: tanx= sin x/cos x. If you let u= cos x then du= -sin x dx so $\int tan x dx= -\int (1/u)du= --ln|u|+ C= -ln|cos x|+ C$. Of course, tan 2y= sin 2y/cos 2y. If you let u= cos 2y, then du= 2 sin 2y dy so $$\int tan 2y dy= -\frac{1}{2}\int (1/u)du= -\frac{1}{2}ln u+ C= -\frac{1}{2} ln|cos 2y|$$.

$$\int tan x dx+ \int tan 2y dy= -ln|cos x|- \frac{1}{2}ln|cos 2y|+ C$$

Of course, you didn't tell us what the actual problem is so I have no idea how you would decide what C is!

Yes, but the "1/u" is where ln|cos x| comes from: tanx= sin x/cos x.

Oops, I should have seen that.

Of course, you didn't tell us what the actual problem is so I have no idea how you would decide what C is!

Oh, but I did state the initial conditions in my OP! Here they are again: $y(0) = \pi/2$

I worked from where you left off (where we both agree) and I got
$$C^2 = |\cos 2y||\cos^2 x|$$

So with the initial conditions

$$C^2 = |-1||1| \Leftrightarrow C = \sqrt{1}$$

I can get -1 out of that, but why choose it over 1? Also, the answer stated in my OP (as given in my book) has no absolute value signs, why's that?

Last edited:
benorin
Homework Helper
Quick recap,

$$\int \tan x dx+ \int \tan 2y dy = -\ln |\cos x|- \frac{1}{2}\ln |\cos 2y|+ C=0$$​

notice that since

$$-1\leq \cos x\leq 1 \Rightarrow 0\leq |\cos x| \leq 1\Rightarrow -\infty \leq \ln |\cos x| \leq 0 \Rightarrow 0 \leq -\ln |\cos x| \leq \infty ,$$​

and likewise we have $$0 \leq - \frac{1}{2}\ln |\cos 2y| \leq \infty$$ so that

$$0 \leq -\ln |\cos x| - \frac{1}{2}\ln |\cos 2y| \leq \infty$$​

but

$$-\ln |\cos x| - \frac{1}{2}\ln |\cos 2y| +C=0$$​

so it must be that $$C\leq 0,$$ so choose the value $$C=-1$$.