Question
Evaluate:
∫ex(sinx+cosx)dx
This appeared in JEE Main 2024 Shift 2 and is a classic one-step problem — if you know the formula.
Solution — Step by Step
The integrand is ex(sinx+cosx). We need to check whether this fits the form ex[f(x)+f′(x)].
Ask yourself: is cosx the derivative of sinx? Yes. So let f(x)=sinx, which gives f′(x)=cosx.
The formula states:
∫ex[f(x)+f′(x)]dx=exf(x)+C
This is a direct result — no substitution, no integration by parts needed.
Since f(x)=sinx:
∫ex(sinx+cosx)dx=exsinx+C
Final Answer: exsinx+C
Why This Works
The formula ∫ex[f(x)+f′(x)]dx=exf(x)+C comes from reversing the product rule. When we differentiate exf(x), we get exf′(x)+exf(x)=ex[f(x)+f′(x)]. So integration just undoes that.
This is why the formula requires exactly f(x) and its derivative f′(x) paired together. The ex acts as a multiplier throughout — it never changes form under differentiation, which is what makes this trick possible.
In board and JEE exams, this formula covers a whole family of questions. Any time you spot ex multiplied by two functions where one is the derivative of the other, you can write the answer in one step.
Alternative Method
We can verify using integration by parts twice — but honestly, this is the hard way. Use it only to build intuition or verify.
Let I=∫exsinxdx+∫excosxdx.
Integrate ∫excosxdx by parts:
∫excosxdx=excosx+∫exsinxdx
Substituting back:
I=∫exsinxdx+excosx+∫exsinxdx
Now integrate ∫exsinxdx by parts:
∫exsinxdx=exsinx−∫excosxdx
Substitute this in and the ∫excosxdx terms cancel cleanly, leaving I=exsinx+C.
In exams, never use this two-step parts approach unless the question explicitly asks you to verify. The formula method is 10 seconds; the parts method is 3 minutes with a real risk of sign errors.
Common Mistake
Students often write ∫ex(sinx+cosx)dx=ex(sinx+cosx)+C — thinking the whole bracket multiplies ex in the answer. This confuses the integrand pattern with the result pattern. The formula gives exf(x), not ex[f(x)+f′(x)]. Only f(x)=sinx appears in the answer, not cosx.
A quick self-check: differentiate your answer exsinx+C. You should get back exsinx+excosx=ex(sinx+cosx). If it matches the original integrand, you’re correct.