Antiderivative of secant

(Yes, I’m bored. So why not completing my series.)

Antiderivative of tangent

First, remember that \dfrac{d}{dx} \ln |x| = \dfrac{1}{x}, so by chain rule we obtain \dfrac{d}{dx} \ln |f(x)| = f'(x) \cdot \dfrac{1}{f(x)} = \dfrac{f'(x)}{f(x)}. By the (first) fundamental theorem of calculus, derivative and antiderivative are two inverse operations, thus we obtain \displaystyle\int \dfrac{f'(x)}{f(x)} \, dx = \ln |f(x)| + C.

Also, recall that \dfrac{d}{dx} \tan x = \sec^2 x and \dfrac{d}{dx} \sec x = \sec x \tan x. Don’t tell me you don’t know this; if you don’t, then stop reading.

To the real meat.

\displaystyle\int \sec x \, dx

= \displaystyle\int \dfrac{\sec x (\tan x + \sec x)}{\tan x + \sec x} \, dx (!)

= \displaystyle\int \dfrac{\sec^2 x + \sec x \tan x}{\tan x + \sec x} \, dx

Letting f(x) = \tan x + \sec x, we have f'(x) = \sec^2 x + \sec x \tan x (!). Thus,

= \displaystyle\int \dfrac{f'(x)}{f(x)} \, dx

Which by our lemma above is equal to

= \ln |f(x)| + C

= \ln |\tan x + \sec x| + C (Hint: Wikipedia is your friend.)

Usually I stop here, but you can also simplify it to involve only one trigonometric function:

\tan x + \sec x

= - \cot \left( x + \frac{\pi}{2} \right) + \dfrac{1}{\cos x}

= - \dfrac{1}{\tan \left( x + \frac{\pi}{2} \right)} + \dfrac{1}{\sin \left( x + \frac{\pi}{2} \right)} (!)

Call a = \dfrac{x}{2} + \dfrac{\pi}{4}. So

= - \dfrac{1}{\tan 2a} + \dfrac{1}{\sin 2a}

= - \dfrac{1}{ \dfrac{2 \tan a}{1 - \tan^2 a} } + \dfrac{1}{2 \sin a \cos a}

= - \dfrac{1 - \tan^2 a}{2 \tan a} + \dfrac{\sec a}{2 \sin a}

= \dfrac{\tan^2 a - 1}{2 \tan a} + \dfrac{\sec a}{2 \sin a \cdot \frac{\cos a}{\cos a}}

= \dfrac{\tan^2 a - 1}{2 \tan a} + \dfrac{\sec a}{2 \cos a \cdot \frac{\sin a}{\cos a}}

= \dfrac{\tan^2 a - 1}{2 \tan a} + \dfrac{\sec^2 a}{2 \tan a}

= \dfrac{\tan^2 a - 1 + \sec^2 a}{2 \tan a}

= \dfrac{\tan^2 a + \tan^2 a}{2 \tan a} (remember \tan^2 x + 1 = \sec^2 x?)

= \dfrac{2 \tan^2 a}{2 \tan a}

= \tan a

= \tan \left( \dfrac{x}{2} + \dfrac{\pi}{4} \right)

Thus \displaystyle\int \sec x \, dx = \ln \left| \tan \left( \dfrac{x}{2} + \dfrac{\pi}{4} \right) \right| + C.

Now, what happens to \displaystyle\int \sec^3 x \, dx

Antiderivative of tan x

I was toying with Problem 317 on Project Euler when I found a messy (but rather easy) antiderivative of a polynomial (with messy coefficients of course). Somehow whatever train of thoughts led me to think of the antiderivative of tan x. (That’s extremely sidetracked, but whatever. My initial guess of 2.4 million something was wrong anyway 😛 )

And it is pretty surprising.

Letting u = \cos x, we have du = -\sin x \,dx. Hence
\displaystyle \int \tan x \,dx = \int - \dfrac{-\sin x \,dx}{\cos x} = \int -\dfrac{du}{u} = - \ln |u| + C = - \ln |\cos x| + C.

Wild Logarithm appeared! But seriously. This is pretty amusing. Well, if you know \dfrac{d}{dx} \arctan x = \dfrac{1}{1 + x^2}, this is not that amusing, but still.

Math has always mesmerized me with its beautiful, unexpected results. However, it requires deep thought to actually understand it, hence a boatload of dislikes to math. In my class of 22 students, only one goes deep to math (namely me); one or two are good at school math, a few more okay, but that’s it; the rest are…uh…terrible. Of course, you cannot ask the opinion of a person who really digs math about math in these settings (aka the question about how his classmates are progressing in math); that’s biased.

Recently, namely 2.5 hours ago, I’ve just finished tutoring seven of my classmates for about 5.5 hours about math. Tomorrow is math (and history) finals exam, and it involves four topics: antiderivatives and integrals, matrices, vectors, and geometric transformation. I almost gave a very terrible problem (find the area enclosed between y = e^x - 1 and y = \ln (x+1), later revised to be base 2 instead of e); it’s terrible just because finding the intersection points will be a nightmare for them. Although I’m positive that most readers of this post can solve the problem without too much effort (note that the former is convex and the latter is concave, so they cut at at most two points, and they can be found easily).

Appreciating math (or any subject for that matter) is hard. I tend not to appreciate Indonesian (mostly because of severely flawed and broken “opinion-type” questions, where English should have anyway but our English focus more on grammar and reading); there might be someone out there who loves Indonesian more than their spouse (if there is any). Sometimes someone simply doesn’t appreciate any subject at all. I don’t have any right to judge; it might be that they like something else.

However, if you have the patience and logic to grasp the hidden beauty of math masked by mindless exercises such as \int x \sin x + x \sin x^2 \,dx, you might just stare in awe (or in confusion; again note that you need logic) of the beauty of math. You might even be amazed of the wonders of antiderivatives; note that the above example employs both partial integration (for first term) and integration by substitution (for second term) while differing only a number in its expression. So beautiful, so orderly.

Now that I’ve written too much, I might better sleep and prepare for tomorrow. It’s going to be a big day. (Those seven will come again for tutor on Tuesday’s Physics. 😛 )

Limits

Yay first post about my school

So we learn limits in math class now. As I expected, the teacher didn’t explain properly (like the concept was kinda off), so almost everyone* didn’t understand and asked everyone who understood.

* All except me and one other person, obviously besides the teacher