# Mr. Nasty
## Only has trig functions
- Product of sines and cosines
- Odd cosine power
- Save one cosine factor and use $\cos^2{x} = 1 - \sin^2{x}$ to express the rest in terms of $\sin{x}$ and substitute $u = \sin{x}$:
$\int{\sin^m{x}\cos^{2k+1}{x}}dx = \int{\sin^m{x}(\cos^2{x})^k\cos{x}dx} = \int{\sin^m{x}(1 - \sin^2{x})^k\cos{x}dx}$
- Odd sine power
- Save one sine factor and use $\sin^2{x} = 1 - \cos^2{x}$ to express the rest in terms of $\cos{x}$ and substitute $u = \cos{x}$:
$\int{\cos^m{x}\sin^{2k+1}{x}}dx = \int{\cos^m{x}(\sin^2{x})^k\sin{x}dx} = \int{\cos^m{x}(1 - \cos^2{x})^k\sin{x}dx}$
- Both even powers
- Use the identities $\sin^2{x} = \frac{1}{2}(1 - \cos{2x})$ and $\cos^2{x} = \frac{1}{2}(1 + \cos{2x})$ to express everything in terms of $\cos{2x}$ and restart the flowchart.
- Same powers
- $\int{(\sin{x}\cos{x})^n dx}$
- Use the identity $\sin{x}\cos{x} = \frac{1}{2}\sin{2x}$ to express everything in terms of $\sin{2x}$ and restart the flowchart.
- $\int{\sin{mx}\cos{nx}}dx$
- $\sin{a}\cos{b} = \frac{1}{2}(\sin{(a - b)} + \sin{(a + b)})$
- $\int{\sin{mx}\sin{nx}dx}$
- $\sin{a}\sin{b} = \frac{1}{2}(\cos{(a - b)} - \cos{(a + b)})$
- $\int{\cos{mx}\cos{nx}dx}$
- $\cos{a}\cos{b} = \frac{1}{2}(\cos(a - b) + \cos(a + b))$
- Product of secants and tangents
- Even secant power $\ge 2$
- Save a factor of $\sec^2{x}$ and use $\sec^2{x} = 1 + \tan^2{x}$ to express everything else in terms of $\tan{x}$ and substitute $u = \tan{x}$:
$\int{\tan^m{x} \sec^{2k}{x} dx} = \int{\tan^m{x} (\sec^2{x})^{k - 1} \sec^2{x} dx} = \int{\tan^m{x} (1 + \tan^2{x})^{k - 1} \sec^2{x} dx}$
- Odd tangent power
- Save a factor of $\sec{x}\tan{x}$ and use $\tan^2{x} = \sec^2{x} - 1$ to express everything else in terms of $\sec{x}$ and substitute $u = \sec{x}$:
$\int{\tan^{2k + 1}{x} \sec^n{x} dx} = \int{(\tan^2{x})^k \sec^{n - 1}{x} \sec{x} \tan{x} dx} = \int{(\sec^2{x} - 1)^k \sec^{n - 1}{x} \sec{x} \tan{x} dx}$
- Use anti-derivatives of $\sec{x}$ and $\tan{x}$
- $\int{\sec{x} dx} = \ln{|\sec{x} + \tan{x}|} + C$
- $\int{\tan{x} dx} = \ln{|\sec{x}| + C}$
## Rational function
- $\frac{du}{u}$
- substitution
- Factorable denominator
- Degree top $\ge$ degree bottom
- Long division
- Partial Fraction
- Distinct linear factors
- $\frac{A_1}{a_1x + b_1} + \frac{A_2}{a_2x + b_2} \cdots$
- Repeated linear factors
- $\frac{a}{(ax + b)^n} = \frac{A_1}{ax + b} + \frac{A_2}{(ax + b)^2} + \cdots + \frac{A_n}{(ax + b)^n}$
- Distinct irreducible quadratic factors
- $\frac{a}{(x^2 + a_1^2)(x^2 + a_2^2)} = \frac{Ax + B}{x^2 + a_1^2} + \frac{Cx + D}{x^2 + a_2^2}$
- Complete the square if necessary
- Use $\arctan{x}$
- Repeated irreducible quadratic factor
- $\frac{n}{(ax^2 + bx + c)^n} = \frac{A_1 + B_1}{ax^2 + bx + c} + \frac{A_2 + B_2}{(ax^2 + bx + c)^2} + \cdots + \frac{A_n + B_n}{(ax^2 + bx + c)^n}$
- Degree top $\lt$ degree bottom
- Partial Fraction
- Unfactorable denominator
- $x^2 + a^2$ term
- Trig substitution with $x = b\tan{\theta}$
- Complete the square to create an $x^2 + a^2$ term
- Trig substitution with $x = b\tan{\theta}$
## Radical expression
- $\sqrt{a^2 - x^2}$
- Substitute $x = a\sin{\theta}$
- $\sqrt{a^2 + x^2}$
- Substitute $x = a\tan{\theta}$
- $\sqrt{x^2 - a^2}$
- Substitute $x = a\sec{\theta}$
## By parts friendly factors
- $\mathrm{polynomial \times transcendental(trig, exp, log)}$
- Integration by parts