On this page
Some integrals never finish when you integrate by parts: after two rounds you are back where you started. For eᵃˣ sin bx that is not a dead end. It is the method. This post shows how the cyclic trick works, derives the general formulas so you can check any answer, and works four integrals that go beyond the NCERT example.
Where is this in the syllabus?
The NCERT Class 12 chapter Integrals (Reprint 2026-27) works ∫eˣ sin x dx as Example 21 and sets ∫e²ˣ sin x dx as Exercise 7.6, Question 21. The JEE (Main) 2026 syllabus and the CBSE 2026-27 mathematics curriculum both list integration by parts, and the JEE (Advanced) 2026 brochure lists it too. Check your exam year's documents.
For how to choose the first function in general, see our guide to integration by parts and LIATE.
How does the cyclic trick work?
Let I = ∫eᵃˣ sin bx dx. NCERT takes the exponential as the first function in its example. Here we take sin bx as the first function and eᵃˣ as the second; either works, as long as you keep the same type of choice in both rounds.
Round 1. I = sin bx × (eᵃˣ/a) − ∫ b cos bx × (eᵃˣ/a) dx = (eᵃˣ sin bx)/a − (b/a) J, where J = ∫eᵃˣ cos bx dx.
Round 2. Again take the trigonometric function as first: J = (eᵃˣ cos bx)/a + (b/a) I.
Substitute: I = (eᵃˣ sin bx)/a − (b/a²) eᵃˣ cos bx − (b²/a²) I.
Solve for I: I (1 + b²/a²) = eᵃˣ(a sin bx − b cos bx)/a², so
∫eᵃˣ sin bx dx = eᵃˣ(a sin bx − b cos bx)/(a² + b²) + C
and by the same steps
∫eᵃˣ cos bx dx = eᵃˣ(a cos bx + b sin bx)/(a² + b²) + C.
Put a = b = 1 in the first and you get NCERT's answer to Example 21: (eˣ/2)(sin x − cos x) + C.
Worked example 1: a cosine with different a and b
∫e²ˣ cos 3x dx. Here a = 2, b = 3 and a² + b² = 13.
Answer: e²ˣ(2 cos 3x + 3 sin 3x)/13 + C.
Check by differentiating. The derivative of e²ˣ(2 cos 3x + 3 sin 3x) is 2e²ˣ(2 cos 3x + 3 sin 3x) + e²ˣ(−6 sin 3x + 9 cos 3x) = e²ˣ(13 cos 3x). Divide by 13 and you get the integrand back.
Worked example 2: a definite integral
∫ from 0 to π of eˣ sin x dx.
Antiderivative: (eˣ/2)(sin x − cos x).
At x = π: (e^π/2)(0 − (−1)) = e^π/2. At x = 0: (1/2)(0 − 1) = −1/2.
Answer: e^π/2 + 1/2 = (e^π + 1)/2 ≈ 12.07. The value is positive, as it should be: sin x ≥ 0 on [0, π].
Worked example 3: a negative exponent
∫ from 0 to π/2 of e⁻ˣ sin 2x dx. Here a = −1, b = 2 and a² + b² = 5.
Antiderivative: e⁻ˣ(−sin 2x − 2 cos 2x)/5.
At π/2: sin π = 0 and cos π = −1, so e^(−π/2)(0 + 2)/5 = 2e^(−π/2)/5. At 0: (0 − 2)/5 = −2/5.
Answer: (2/5)(1 + e^(−π/2)) ≈ 0.483.
The signs are where marks go. Put a = −1 carefully: a sin bx − b cos bx = −sin 2x − 2 cos 2x.
Worked example 4: combine with an identity
∫eˣ sin²x dx. Use sin²x = (1 − cos 2x)/2 first:
= (1/2)∫eˣ dx − (1/2)∫eˣ cos 2x dx = eˣ/2 − (1/2) × eˣ(cos 2x + 2 sin 2x)/5 + C
= eˣ/2 − eˣ(cos 2x + 2 sin 2x)/10 + C.
Differentiating gives eˣ sin²x again, which we checked symbolically.
Is there a neater way to write the answer?
Yes. Since a sin bx − b cos bx = √(a² + b²) sin(bx − φ) with tan φ = b/a, the integral is eᵃˣ sin(bx − φ)/√(a² + b²) + C. This is the same idea as finding the range of a sin θ + b cos θ, covered in our post on the range of a sin x + b cos x.
Which mistakes cost marks?
Switching the first function between rounds. You get I = I and nothing else.
Dropping the minus sign when integrating sin bx to −cos bx/b.
Forgetting to solve for I. The integral is an unknown to collect on one side.
Mixing up the sine and cosine formulas. Check by differentiating, as in Worked example 1. It takes a minute.
Leaving out + C in indefinite integrals.
A practice routine
Derive the sine formula from scratch twice this week, once with each choice of first function.
Solve NCERT Exercise 7.6 Q21 and check it against the general formula with a = 2, b = 1.
Do three definite integrals with negative or fractional a.
Differentiate every answer you get.
If a sign keeps going wrong and you cannot see which line, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer, so you can compare it with yours line by line.
Today, find ∫e³ˣ sin 4x dx with the formula, then differentiate your answer to check it.



