# 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$

# Chess 4: How Is Castling Possible Again?

These chess problems require you to understand the rules of chess. Assume White is on the bottom.

Expected difficulty MediumComment/E-mail if you want a solution to be published

Stipulation (12+13) White can still castle. Which unit made White’s last move? (Note that you’re not told whose move it is.)

Here’s one more. Apparently constructing chess compositions is harder than constructing logic puzzles…

# Prepositions

Argh.

Which of the following words fits the best in the blank?

Words: on/in/at

Phrase: “Chaos ____ the sky” is a noun phrase.

Yes, even this blog’s title has a 2/3 chance of being grammatically incorrect. (I went with “at” because the acronym is a common word.)

On a very unrelated note, apparently some people found this blog by searching “antiderivative of tangent“. Should I write some more posts that might be hit by a random googler?

# Puzzle 80: Hardcore Mode

Counting Count the number of paths from S (start) to G (goal) that stays along the white roads. Paths cannot use the same road twice but may visit the same intersection twice. As an example, the pink path shows one valid path.

Expected difficulty InsaneAnswerComment/E-mail if you want a solution to be published

Puzzle 80: Hardcore Mode
Counting

Erm. You may use a calculator or a program. (If you managed to program the solution, then you deserve the answer. I’m not responsible if you miscalculate when you’re multiplying large numbers by hand.)

This is a rejected puzzle of a set born out of a stupid idea. Why did I even think of this? The good news is I have a free Brilliant.org problem idea, and I can practice my programming skills.

# Chess 3: Weirdest Stipulation Ever

These chess problems require you to understand the rules of chess.

Expected difficulty MediumComment/E-mail if you want a solution to be published

Stipulations Color the pieces so that there exists a game where this position is illegal due to FIDE Chess Law 5.2b (also known as Dead Reckoning), but legal otherwise.

Made from phone, so it’s hard to add comments, but it’s basically a really stupid problem. I might put the solution soon. And I’m expecting a cook here, that there exists other solutions I didn’t consider or something. But if there’s none then, well, good.

# Chess 2: Missing Piece

These chess problems require you to understand the rules of chess.

Expected difficulty MediumComment/E-mail if you want a solution to be published

Stipulations a) On what square was the rook on f1 at the beginning of the game? b) What color and piece is on h2 (the black circle)? Mention all pieces that can be on that square. (Just so part a is well-defined, I assure you at least one piece works.)

So here’s another one, which I should say is the best piece I’ve ever composed to date. (Yes, if this is the best piece then you know how beginner I am in compositions.) I might post some problems that aren’t composed by me, but I find interesting nevertheless…

# Puzzle 79: Hidden Object

Expected difficulty HardFor personal reasons, I decide not to release the answer/solution for this puzzle. Sorry

Puzzle 79: Hidden Object
Nonogram
(click to enlarge)