Integration by parts
NCERT Class 12 Mathematics Chapter 7 Section 7.6
Quick answer
Integration by parts integrates a product: ∫f g dx = f ∫g dx − ∫[f′ ∫g dx] dx, where the first function f should become simpler when differentiated, and 1 can serve as the second function, as in ∫log x dx = x log x − x + C. When the integral reappears, as in ∫e sin x dx, collect it on one side and solve. Two results follow: ∫e[f(x) + f′(x)] dx = e f(x) + C, and standard formulas for √(x ± a) and √(a − x).
With your textbook
NCERT Mathematics Part II (Class 12), Chapter 7 “Integrals”, Section 7.6 “Integration by Parts”, pages 259–266.
Open the official NCERT chapter (PDF, 5.7 MB, ncert.nic.in) (opens in a new tab)
Checked against the 2026-27 reprint on .
What is integration by parts?
Integration by parts
In this section, we describe one more method of integration, that is found quite useful in integrating products of functions.
NCERT Mathematics Part II (Class 12), Section 7.6, page 259
- For a first function f and a second function g (NCERT page 260):
Integration by parts
∫f(x) g(x) dx = f(x) ∫g(x) dx
− ∫(f′(x) ∫g(x) dx) dx
In plain words: the integral of a product is (first function) × (integral of the second), minus the integral of (derivative of the first) × (integral of the second). NCERT derives it on pages 259–260 by integrating the product rule d/dx (uv) = u dv/dx + v du/dx and rearranging. Integration by parts trades one integral for another. It helps when differentiating the first function makes it simpler (a power of x drops a degree, log x becomes 1/x) while the second function is easy to integrate.
Choosing the first function
NCERT Example 17 (page 260): for ∫x cos x dx, take f(x) = x and g(x) = cos x. Then
∫x cos x dx = x sin x − ∫sin x dx
= x sin x + cos x + C.
With the choice the other way round, the new integral is ∫sin x × (x2/2) dx, which is harder: the choice matters. NCERT’s Remarks (pages 260–261):
- Take a power of x or a polynomial as the first function, unless the other function is an inverse trigonometric or a logarithmic function; then that one is first.
- No constant is needed when integrating the second function: it cancels out in the end.
Beyond the NCERT text, a common classroom mnemonic for the order is ILATE (Inverse trigonometric, Logarithmic, Algebraic, Trigonometric, Exponential): the earlier one is usually the first function. It is a guide, not a rule.
When there is no second function, use 1. NCERT Example 18 (page 261): ∫log x dx = log x × x − ∫(1/x) × x dx = x log x − x + C. NCERT Example 19: ∫xex dx = xex − ex + C. NCERT Example 20 (pages 261–262) takes sin x first in ∫x sin x/√(1 − x2) dx; the integral of the second function is −√(1 − x2), and the answer is x − √(1 − x2) sin x + C.
When the integral comes back. NCERT Example 21 (page 262): for I = ∫ex sin x dx, two integrations by parts give I = −ex cos x + ex sin x − I. Solving for I:
∫ex sin x dx = (ex/2)(sin x − cos x) + C.
NCERT slip (page 260): Remark (i) says the method does not work for ∫√x sin x dx because “there does not exist any function whose derivative is √x sin x”. An anti derivative does exist (the area function of NCERT Section 7.8 (page 267) gives one for any continuous function); the elementary integration table is insufficient here. In fact, parts followed by u = √x gives −√x cos x + ∫cos (u) du, a Fresnel-type integral beyond this chapter. Existence of an anti derivative and an elementary formula for it are different questions; NCERT itself notes on page 234 that some anti derivatives are not expressible in terms of elementary functions. In an exam, say that this integral cannot be found in terms of elementary functions.
The type ∫e[f(x) + f′(x)] dx
NCERT Section 7.6.1 (pages 262–263) integrates exf(x) by parts; the term ∫f′(x)ex dx that appears cancels the second half of the integrand:
The e[f + f′] integral
∫e[f(x) + f′(x)] dx = e f(x) + C
So look for a function and its derivative inside the bracket. NCERT Example 22 (page 263): in ∫ex(tan x + 1/(1 + x2)) dx, f(x) = tan x, so the integral is ex tan x + C. In ∫(x2 + 1)ex/(x + 1)2 dx, write x2 + 1 = (x2 − 1) + 2: the bracket is (x − 1)/(x + 1) + 2/(x + 1)2, a function and its derivative, so the integral is ex(x − 1)/(x + 1) + C.
Three integrals with a square root
Take a > 0 and work on intervals where the roots are real: |x| > a for √(x − a), |x| < a for √(a − x), and all real x for √(x + a). Integrating by parts with 1 as the second function gives three more standard results (NCERT Section 7.6.2, pages 264–265):
Square-root integrals (each + C)
∫√(x − a) dx = (x/2)√(x − a)
− (a/2) log |x + √(x − a)|
∫√(x + a) dx = (x/2)√(x + a)
+ (a/2) log |x + √(x + a)|
∫√(a − x) dx = (x/2)√(a − x)
+ (a/2) sin (x/a)
For the first, NCERT writes I = x√(x2 − a2) − ∫x2/√(x2 − a2) dx, splits x2 = (x2 − a2) + a2, and finds I on the right again, so 2I equals x√(x2 − a2) minus a2 log |x + √(x2 − a2)|, from NCERT 7.4 (4), page 244.
A quadratic under the root is first written as a perfect square plus or minus a constant. NCERT Example 23 (page 265): x2 + 2x + 5 = (x + 1)2 + 22, so
∫√(x2 + 2x + 5) dx = ½(x + 1)√(x2 + 2x + 5)
+ 2 log |x + 1 + √(x2 + 2x + 5)| + C.
NCERT Example 24 (pages 265–266): 3 − 2x − x2 = 4 − (x + 1)2, so the integral of its square root is ½(x + 1)√(3 − 2x − x2) + 2 sin ((x + 1)/2) + C.
Solved examples
Example 1: Parts twice (NCERT Exercise 7.6, Q3, page 263)
Find ∫x2ex dx.
With x2 first: ∫x2ex dx = x2ex − ∫2xex dx, and ∫xex dx = xex − ex (NCERT Example 19). So the integral is x2ex − 2xex + 2ex + C.
Answer: ex(x2 − 2x + 2) + C.
Example 2: An inverse function first (NCERT Exercise 7.6, Q8, page 263)
Find ∫x tan x dx.
tan x first: (x2/2) tan x − ½∫x2/(1 + x2) dx. Since x2/(1 + x2) = 1 − 1/(1 + x2), the last integral is x − tan x.
Answer: ½(x2 + 1) tan x − x/2 + C.
Example 3: A power times sec x (NCERT Exercise 7.6, Q12, page 263)
Find ∫x sec2 x dx.
x first, sec2 x second: x tan x − ∫tan x dx, and ∫tan x dx = −log |cos x|.
Answer: x tan x + log |cos x| + C.
Example 4: Spot f + f′ (NCERT Exercise 7.6, Q18, page 264)
Find the integral of ex(1 + sin x) divided by 1 + cos x.
With 1 + cos x = 2 cos2 (x/2) and sin x = 2 sin (x/2) cos (x/2), the fraction is ½ sec2 (x/2) + tan (x/2). That is f′(x) + f(x) with f(x) = tan (x/2).
Answer: ex tan (x/2) + C.
Example 5: Choose the correct answer (NCERT Exercise 7.7, Q11, page 266)
∫√(x2 − 8x + 7) dx is equal to (A) ½(x − 4)√(x2 − 8x + 7) + 9 log |x − 4 + √(x2 − 8x + 7)| + C; (B) ½(x + 4)√(x2 − 8x + 7) + 9 log |x + 4 + √(x2 − 8x + 7)| + C; (C) ½(x − 4)√(x2 − 8x + 7) − 3√2 log |x − 4 + √(x2 − 8x + 7)| + C; (D) ½(x − 4)√(x2 − 8x + 7) − (9/2) log |x − 4 + √(x2 − 8x + 7)| + C.
x2 − 8x + 7 = (x − 4)2 − 32, so the first square-root formula applies with a = 3 and x − 4 in place of x: the log term is −(9/2) log.
Answer: (D).
Common mistakes to avoid
Common mistake
Taking the wrong first function
In ∫x cos x dx, taking cos x first raises the power of x (NCERT Example 17). If the new integral is harder than the old one, swap the two functions.
Common mistake
Using parts where a substitution is enough
∫x2ex3 dx needs t = x3, not parts: the answer is (1/3)ex3 + C (NCERT Exercise 7.6, Q23, page 264).
Common mistake
Missing the sign in the √(x − a) result
The log term is − (a2/2) log for √(x2 − a2) and + (a2/2) log for √(x2 + a2). Check by differentiating the answer.
Quick revision summary
- ∫f g dx = f ∫g dx − ∫(f′ ∫g dx) dx: choose as f the function that becomes simpler when differentiated; with no second function, use 1.
- If the integral reappears, as in ∫ex sin x dx, collect it on one side and solve.
- ∫ex[f(x) + f′(x)] dx = exf(x) + C.
- The three square-root integrals come from parts with 1 as the second function; a quadratic under the root is first completed to a square.
Formula sheet
- ∫f g dx = f ∫g dx − ∫(f′ ∫g dx) dx
- ∫e[f(x) + f′(x)] dx = e f(x) + C
- ∫log x dx = x log x − x + C
- ∫√(a − x) dx = (x/2)√(a − x) + (a/2) sin (x/a) + C
Questions students ask
ILATE or LIATE: which is correct for integration by parts?
ILATE and LIATE are both fine guides to the first function in integration by parts: they differ only in the order of inverse trigonometric and logarithmic functions, which rarely meet in one integrand. Neither is NCERT’s, whose Remark (iii) (page 261) only says when a power of x comes first, and neither is absolute: the second function must be one you can integrate. In ∫x3ex2 dx, ILATE’s x3 first leaves ex2, which no method of the chapter integrates; x2 first and xex2 second gives ½ex2(x2 − 1) + C.
What is the tabular (DI) method of integration by parts, and is it Bernoulli’s formula?
The tabular or DI method is integration by parts repeated in one line; as a formula it is what some Indian textbooks call Bernoulli’s formula (beyond the NCERT text, reasoned by repeating parts): ∫uv dx is uv1 − u′v2 + u″v3 − …, with v1, v2, v3 the first, second and third integrals of v, stopping when a derivative of u is 0. With u = x3 and v = ex, ∫x3ex dx is ex times (x3 − 3x2 + 6x − 6), plus C. Terminating this way needs a polynomial u, whose derivatives run out. More generally the table can stop with a remainder integral, or reveal a cycle: with ex sin x, solve for the recurring integral instead of waiting for a zero derivative.
What is the difference between integration by parts and the product rule?
Integration by parts is the product rule integrated: from (uv)′ = u′v + uv′, integrating and rearranging gives ∫uv′ dx = uv − ∫u′v dx, which is NCERT’s formula with u as the first function. The product rule always finishes a derivative, but integration by parts only trades one integral for another, so it helps only when ∫u′v dx is easier than the integral you started with. The product rule is also the quickest check of an answer: for ∫xe−x dx, whose answer is −(x + 1)e−x + C, differentiating gives −e−x + (x + 1)e−x, which is xe−x.
Does it matter which function is taken first in ∫ex sin x dx?
In ∫ex sin x dx either function can be taken first, since both are easy to integrate and neither gets simpler when differentiated, but the second integration by parts must keep the same kind of function first. With ex first, I = −ex cos x + J, where J = ∫ex cos x dx; if cos x is now taken first, J comes out as ex cos x + I, and everything cancels to I = I, which says nothing. Keeping the same kind first both times brings back −I, so that I can be solved for, as in NCERT Example 21 (page 262); the same steps give ∫ex cos x dx as (ex/2)(sin x + cos x), plus C.
Is there an ekx version of the ∫ex[f + f′] dx rule?
The ex[f + f′] rule has a version for any constant k (beyond the NCERT text, reasoned from the product rule): the derivative of ekxf(x) is ekx[kf(x) + f′(x)], so the integral of ekx[kf(x) + f′(x)] is ekxf(x) + C, and k = 1 is NCERT’s result. For ∫e3x(3x2 + 2x) dx, f(x) = x2 fits, so the answer is x2e3x + C. With k = −1 the bracket is f′(x) − f(x), as in ∫e−x(cos x − sin x) dx, which is e−x sin x + C.
Practice questions
Try each question first, then open the answer to check your working.
-
Q1. Find ∫x sin x dx and ∫x sin 3x dx (NCERT Exercise 7.6, Q1 and Q2, page 263).
Show answerHide answer
−x cos x + ∫cos x dx = −x cos x + sin x + C. And −(x/3) cos 3x + (1/3)∫cos 3x dx = −(x/3) cos 3x + (1/9) sin 3x + C.
-
Q2. Find ∫x log x dx and ∫x2 log x dx (NCERT Exercise 7.6, Q4 and Q6, page 263).
Show answerHide answer
With log x first: (x2/2) log x − ∫(x/2) dx = (x2/2) log x − x2/4 + C, and (x3/3) log x − ∫(x2/3) dx = (x3/3) log x − x3/9 + C.
-
Q3. Find ∫ex(sin x + cos x) dx and ∫xex/(1 + x)2 dx (NCERT Exercise 7.6, Q16 and Q17, page 264).
Show answerHide answer
The first is ex[f + f′] with f = sin x: ex sin x + C. For the second, x/(1 + x)2 = 1/(1 + x) − 1/(1 + x)2, which is f + f′ with f = 1/(1 + x): ex/(1 + x) + C.
-
Q4. Find ∫√(4 − x2) dx (NCERT Exercise 7.7, Q1, page 266).
Show answerHide answer
With a = 2 in the third square-root formula: (x/2)√(4 − x2) + 2 sin (x/2) + C.