In short

Three patterns show up so often that they have their own shortcuts. First, e^{ax}\sin(bx) and e^{ax}\cos(bx) integrate by the cyclic trick: apply by parts twice, the integral reappears, solve algebraically. Second, any integrand of the form e^x(f(x) + f'(x)) integrates to e^x f(x) — no by parts needed. Third, integrals like \int \sin^n x\,dx are handled by a reduction formula that drops the exponent by two each step.

Integration by parts gives you a general tool, but three particular patterns are so important that the smart thing is to learn them as named shortcuts and stop re-deriving them each time. Each shortcut is a one-line consequence of the by-parts formula, and each one lets you skip steps that would otherwise take two or three passes.

Take \int e^{2x}\sin(3x)\,dx. If you try by parts naively, you get another integral — \int e^{2x}\cos(3x)\,dx — that is just as hard. Try again on that, and the original comes back. At first it looks like an infinite regress. But the regress closes: you can solve the repeating integral algebraically. This is the first shortcut.

Or take \int e^x(\sin x + \cos x)\,dx. Notice that \cos x is the derivative of \sin x. The integrand is e^x(f + f') with f = \sin x. The answer is e^x \sin x + C — you can write it down by inspection. This is the second shortcut, and it makes a whole family of integrals trivial.

Third: \int \sin^5 x\,dx. Do it by parts once, and you get an equation that expresses \int \sin^n x\,dx in terms of \int \sin^{n-2} x\,dx. Apply the formula repeatedly until the exponent is 1 or 0, and you are done. This is a reduction formula, and every power-of-a-trig-function integral has one.

This article covers all three.

Shortcut 1: the cyclic trick for e^{ax}\sin(bx) and e^{ax}\cos(bx)

Start with the derivation, since the shortcut is just the result of following the derivation once.

Let I = \int e^{ax}\sin(bx)\,dx. Apply by parts with u = \sin(bx) and dv = e^{ax}\,dx:

u = \sin(bx) \Rightarrow du = b\cos(bx)\,dx, \qquad dv = e^{ax}\,dx \Rightarrow v = \frac{e^{ax}}{a}
I = \sin(bx) \cdot \frac{e^{ax}}{a} - \int \frac{e^{ax}}{a} \cdot b\cos(bx)\,dx = \frac{e^{ax}\sin(bx)}{a} - \frac{b}{a}\int e^{ax}\cos(bx)\,dx

Call the new integral J = \int e^{ax}\cos(bx)\,dx. Apply by parts to J with u = \cos(bx) and dv = e^{ax}\,dx:

J = \cos(bx)\cdot\frac{e^{ax}}{a} - \int \frac{e^{ax}}{a}\cdot(-b\sin(bx))\,dx = \frac{e^{ax}\cos(bx)}{a} + \frac{b}{a}I

Now substitute J back into the first equation:

I = \frac{e^{ax}\sin(bx)}{a} - \frac{b}{a}\left[\frac{e^{ax}\cos(bx)}{a} + \frac{b}{a}I\right] = \frac{e^{ax}\sin(bx)}{a} - \frac{b\,e^{ax}\cos(bx)}{a^2} - \frac{b^2}{a^2}I

The original I has returned. Move it to the left:

I + \frac{b^2}{a^2}I = \frac{e^{ax}\sin(bx)}{a} - \frac{b\,e^{ax}\cos(bx)}{a^2}
\frac{a^2 + b^2}{a^2}I = \frac{a\,e^{ax}\sin(bx) - b\,e^{ax}\cos(bx)}{a^2}

Multiply both sides by \frac{a^2}{a^2 + b^2}:

I = \frac{e^{ax}\bigl(a\sin(bx) - b\cos(bx)\bigr)}{a^2 + b^2} + C

That is the boxed formula. The same computation with \cos(bx) instead of \sin(bx) gives the twin formula.

The exponential-times-trig formulas

\int e^{ax}\sin(bx)\,dx = \frac{e^{ax}\bigl(a\sin(bx) - b\cos(bx)\bigr)}{a^2 + b^2} + C
\int e^{ax}\cos(bx)\,dx = \frac{e^{ax}\bigl(a\cos(bx) + b\sin(bx)\bigr)}{a^2 + b^2} + C

Both answers share the same denominator a^2 + b^2 — and the numerator is always e^{ax} times a sign-adjusted linear combination of \sin(bx) and \cos(bx). Memorise the structure, not the coefficients: you can always recover them from one pass of by parts.

A quick example on the first formula

Example 1: $\int e^{2x}\sin(3x)\,dx$

Step 1. Identify a and b. Here a = 2 and b = 3, so a^2 + b^2 = 4 + 9 = 13. Why: the denominator in the formula is always a^2 + b^2, so finding it is the first thing to do.

Step 2. Plug into the formula.

\int e^{2x}\sin(3x)\,dx = \frac{e^{2x}\bigl(2\sin(3x) - 3\cos(3x)\bigr)}{13} + C

Why: the numerator is e^{ax} times (a\sin(bx) - b\cos(bx)), directly from the boxed formula.

Step 3. Verify by differentiating. Call the answer F(x). Then

F'(x) = \frac{1}{13}\left[2e^{2x}\bigl(2\sin(3x) - 3\cos(3x)\bigr) + e^{2x}\bigl(6\cos(3x) + 9\sin(3x)\bigr)\right]
= \frac{e^{2x}}{13}\left[4\sin(3x) - 6\cos(3x) + 6\cos(3x) + 9\sin(3x)\right] = \frac{e^{2x}}{13}\cdot 13\sin(3x) = e^{2x}\sin(3x)

The cosine terms cancel, the sine terms collect to 13\sin(3x), and dividing by 13 leaves exactly the integrand. Why: the verification is worth doing once; if the sign is wrong on the cosine term, the cosines will not cancel and you will catch the bug immediately.

Result: \int e^{2x}\sin(3x)\,dx = \dfrac{e^{2x}\bigl(2\sin(3x) - 3\cos(3x)\bigr)}{13} + C.

The dashed curve is the integrand $e^{2x}\sin(3x)$ — an oscillation whose amplitude grows exponentially. The solid red curve is the antiderivative. Both curves oscillate with the same period $\frac{2\pi}{3}$ but the antiderivative is phase-shifted, and its amplitude is smaller because of the $\frac{1}{13}$ factor.

Shortcut 2: the e^x(f + f') rule

There is a tidy rule that lets you read off the antiderivative of any integrand that has the shape e^x \cdot [f(x) + f'(x)].

Claim. \int e^x\bigl[f(x) + f'(x)\bigr]\,dx = e^x f(x) + C.

Proof. Just differentiate the right side and check.

\frac{d}{dx}\bigl[e^x f(x)\bigr] = e^x f(x) + e^x f'(x) = e^x\bigl[f(x) + f'(x)\bigr]

That is the integrand. Done.

The rule is really the product rule for (e^x \cdot f)', read backward. Anything of the form e^x(\text{function} + \text{derivative of that function}) integrates to e^x times the function.

The practical use is pattern recognition. When you see e^x multiplied by a sum of two terms, check whether one of the terms is the derivative of the other. If yes, use the rule; if no, you have to fall back on something else.

Example 2: $\int e^x\bigl(\tan x + \sec^2 x\bigr)\,dx$

Step 1. Check for the f + f' pattern. Let f(x) = \tan x. Then f'(x) = \sec^2 x. Why: the integrand is e^x times (\tan x + \sec^2 x), and the second term really is the derivative of the first. The pattern matches.

Step 2. Apply the rule.

\int e^x\bigl(\tan x + \sec^2 x\bigr)\,dx = e^x \tan x + C

Why: nothing to do — the answer is immediate once you identify f.

Step 3. Verify.

\frac{d}{dx}\bigl[e^x \tan x\bigr] = e^x \tan x + e^x \sec^2 x = e^x(\tan x + \sec^2 x)

Matches the integrand.

Result: \int e^x\bigl(\tan x + \sec^2 x\bigr)\,dx = e^x \tan x + C.

The dashed curve is the integrand $e^x(\tan x + \sec^2 x)$, defined on $(-\pi/2, \pi/2)$. The solid red curve is the antiderivative $e^x \tan x$. Both curves blow up as $x \to \pm\pi/2$ (where $\tan x$ diverges), and the antiderivative crosses zero exactly at $x = 0$.

More examples, presented without the full box because the point is to see the pattern-matching:

Each of these would take two or three applications of by parts if you did not recognise the shortcut. That is the value of the rule — not that it extends the class of integrals you can compute, but that it collapses a three-line computation to one line.

What if you have e^{ax}(f + \frac{1}{a}f')? The rule generalises. If you differentiate e^{ax}f(x), you get ae^{ax}f + e^{ax}f' = e^{ax}(af + f'). So the general rule is

\int e^{ax}\bigl(af(x) + f'(x)\bigr)\,dx = e^{ax} f(x) + C

You need the coefficient in front of f to be exactly a, the same a that is in the exponent. For a = 1, this collapses back to the e^x(f + f') rule.

Shortcut 3: reduction formulas

Suppose you want to integrate \int \sin^5 x\,dx. There is no shortcut like the e^x(f+f') rule here, but there is a recursive shortcut: one application of by parts produces a formula that expresses \int \sin^n x\,dx in terms of \int \sin^{n-2} x\,dx. Then you apply the formula repeatedly until the exponent comes down to 0 or 1, which are trivial.

Let me derive the reduction formula for \int \sin^n x\,dx, with n \geq 2. Write \sin^n x = \sin^{n-1} x \cdot \sin x, and take u = \sin^{n-1} x and dv = \sin x\,dx:

u = \sin^{n-1} x \Rightarrow du = (n-1)\sin^{n-2} x\cdot\cos x\,dx
dv = \sin x\,dx \Rightarrow v = -\cos x

By parts:

\int \sin^n x\,dx = -\cos x \sin^{n-1} x + (n-1)\int \sin^{n-2} x\cdot\cos^2 x\,dx

Now use \cos^2 x = 1 - \sin^2 x to split the new integrand:

= -\cos x \sin^{n-1} x + (n-1)\int \sin^{n-2} x\,dx - (n-1)\int \sin^n x\,dx

The original \int \sin^n x\,dx appears on the right. Move it to the left:

\int \sin^n x\,dx + (n-1)\int \sin^n x\,dx = -\cos x\sin^{n-1} x + (n-1)\int \sin^{n-2} x\,dx
n\int \sin^n x\,dx = -\cos x\sin^{n-1} x + (n-1)\int \sin^{n-2} x\,dx

Divide by n:

\boxed{\int \sin^n x\,dx = -\frac{\cos x\sin^{n-1} x}{n} + \frac{n-1}{n}\int \sin^{n-2} x\,dx}

That is the reduction formula for \sin^n x. Each application drops the exponent by 2. By the same derivation (or by the substitution x \mapsto \pi/2 - x) you get

\int \cos^n x\,dx = \frac{\sin x\cos^{n-1} x}{n} + \frac{n-1}{n}\int \cos^{n-2} x\,dx

Using the reduction formula

Take \int \sin^5 x\,dx. Apply the formula with n = 5:

\int \sin^5 x\,dx = -\frac{\cos x\sin^4 x}{5} + \frac{4}{5}\int \sin^3 x\,dx

Apply again to \int \sin^3 x\,dx with n = 3:

\int \sin^3 x\,dx = -\frac{\cos x\sin^2 x}{3} + \frac{2}{3}\int \sin x\,dx = -\frac{\cos x\sin^2 x}{3} - \frac{2}{3}\cos x

Substitute back:

\int \sin^5 x\,dx = -\frac{\cos x\sin^4 x}{5} + \frac{4}{5}\left[-\frac{\cos x\sin^2 x}{3} - \frac{2}{3}\cos x\right] + C
= -\frac{\cos x\sin^4 x}{5} - \frac{4\cos x\sin^2 x}{15} - \frac{8\cos x}{15} + C

Clean closed form. Two applications of the formula.

For even exponents, you eventually land at \int \sin^0 x\,dx = \int 1\,dx = x, and the answer has a bare x in it. For odd exponents you land at \int \sin x\,dx = -\cos x, and the answer is entirely in \sin and \cos.

Other common reduction formulas

Each is a one-application-of-by-parts derivation. You can memorise them if you like, or just re-derive on the spot: the \sin^n derivation above is the template.

Common confusions

Going deeper

The exponential-times-trig formula, the f + f' rule, and the reduction formulas cover most of what you will meet. The rest of this section shows where the first formula comes from via complex exponentials, how the reduction idea extends to products like \sin^m x\cos^n x, and a specific computation that you will meet in definite-integral problems.

The complex-exponential route to the first formula

If you have met e^{i\theta} = \cos\theta + i\sin\theta, the first formula has a one-line derivation. Write e^{ax}\sin(bx) = \text{Im}(e^{ax}e^{ibx}) = \text{Im}(e^{(a+ib)x}). So

\int e^{ax}\sin(bx)\,dx = \text{Im}\int e^{(a+ib)x}\,dx = \text{Im}\left[\frac{e^{(a+ib)x}}{a + ib}\right] + C

Multiply numerator and denominator by a - ib:

= \text{Im}\left[\frac{(a - ib)e^{(a+ib)x}}{a^2 + b^2}\right] + C = \frac{1}{a^2 + b^2}\text{Im}\bigl[(a - ib)e^{ax}(\cos(bx) + i\sin(bx))\bigr] + C

Multiply out and take the imaginary part:

= \frac{e^{ax}}{a^2 + b^2}\cdot\bigl[a\sin(bx) - b\cos(bx)\bigr] + C

Same answer. The cyclic trick in by-parts is doing exactly this complex multiplication, just without making it explicit.

Reduction for \int \sin^m x\cos^n x\,dx

When both a sine power and a cosine power appear together, there are two reduction formulas — one that drops the sine exponent by 2 and one that drops the cosine exponent by 2. The right choice depends on which is even and which is odd. When at least one of them is odd, you do not need reduction at all — you can use substitution. Peel off one factor of the odd one to pair with dx, and use \sin^2 + \cos^2 = 1 to rewrite the rest:

\int \sin^3 x\cos^2 x\,dx = \int \sin^2 x\cdot\cos^2 x\cdot\sin x\,dx = \int (1 - \cos^2 x)\cos^2 x\cdot\sin x\,dx

Set u = \cos x, du = -\sin x\,dx:

= -\int (1 - u^2) u^2\,du = -\int (u^2 - u^4)\,du = -\frac{u^3}{3} + \frac{u^5}{5} + C

Substituting back: -\frac{\cos^3 x}{3} + \frac{\cos^5 x}{5} + C.

When both exponents are even, neither factor peels off cleanly, and you use double-angle identities (\sin^2 x = \frac{1 - \cos 2x}{2} and \cos^2 x = \frac{1 + \cos 2x}{2}) or the reduction formula.

The definite integral \int_0^{\pi/2} \sin^n x\,dx

This is the most-used application of the reduction formula in JEE problems. The definite version of the \sin^n formula is

\int_0^{\pi/2} \sin^n x\,dx = \left[-\frac{\cos x\sin^{n-1} x}{n}\right]_0^{\pi/2} + \frac{n-1}{n}\int_0^{\pi/2}\sin^{n-2} x\,dx

The boundary term is 0 at both endpoints (because \cos(\pi/2) = 0 and \sin 0 = 0), so it vanishes entirely:

\int_0^{\pi/2} \sin^n x\,dx = \frac{n-1}{n}\int_0^{\pi/2}\sin^{n-2} x\,dx

A clean recursion. Starting from \int_0^{\pi/2}\sin^0 x\,dx = \frac{\pi}{2} and \int_0^{\pi/2}\sin x\,dx = 1, you get the famous Wallis product:

\int_0^{\pi/2}\sin^{2m} x\,dx = \frac{(2m-1)(2m-3)\cdots 3\cdot 1}{(2m)(2m-2)\cdots 4\cdot 2}\cdot\frac{\pi}{2}
\int_0^{\pi/2}\sin^{2m+1} x\,dx = \frac{(2m)(2m-2)\cdots 4\cdot 2}{(2m+1)(2m-1)\cdots 3\cdot 1}

The same formulas hold for \cos^n x on the same interval — they are mirror images under x \mapsto \pi/2 - x.

Where this leads next