Skip to content
Integral Calculator
Learn

Choosing substitution or integration by parts

5-minute read · 8 sections

A product sign does not automatically call for integration by parts. In 2x cos(x^2), the factor 2x is the derivative of the inner x^2, so substitution is the useful first move. The shape of the expression matters more than its length.

Read the whole expression before choosing a rule

I start by asking whether the expression is a sum, a constant multiple, a composition or a product of two genuinely variable factors. Sums can often be integrated term by term, and constant factors can be taken outside the integral. That reduces the problem before a more elaborate technique becomes necessary.

For 3x^2 + 2sin(x), the power and trigonometric rules already suffice. A primitive is x^3 − 2cos(x), before adding C. Differentiation returns 3x^2 + 2sin(x). Introducing substitution or parts here would add work without clarifying the calculation. A simple method that covers the whole integrand is my preferred starting point.

Substitution accounts for an inner derivative

In 2x cos(x^2), let u = x^2. Then du = 2x dx, so the integral becomes ∫cos(u) du. A primitive is sin(u), and substituting back gives sin(x^2) + C. Differentiating that result produces cos(x^2) × 2x, which reconstructs the original product.

The derivative factor need not be written immediately beside its inner function, but it must be present with the correct scale. If the integrand is x cos(x^2), then du still equals 2x dx and the missing factor is handled by 1/2 outside the transformed integral. The primitive becomes sin(x^2)/2 + C. Forgetting that half is a common way to obtain a plausible-looking but incorrect formula.

Linear substitution has a predictable scale

For sin(2x − 1), choose u = 2x − 1, so du = 2 dx. The transformed integral is one half of ∫sin(u) du. A primitive is −cos(u)/2, hence −cos(2x − 1)/2 + C. Its derivative is sin(2x − 1) × 2/2, giving the correct integrand.

Likewise, exp(3x + 2) integrates to exp(3x + 2)/3 + C. The general pattern divides by the nonzero inner slope. A zero slope is a constant-expression problem instead, so the formula with division by that slope must not be applied blindly. In the calculator, a constant parameter can control that slope; changing its value changes which rule is valid numerically.

Linear substitutions, with their scale factors
IntegrandInner derivativePrimitive before C
sin(2x−1)2−cos(2x−1)/2
exp(3x+2)3exp(3x+2)/3
3/(2x−1)23 ln(abs(2x−1))/2

Integration by parts exchanges one integral for another

The parts identity is ∫u dv = uv − ∫v du. It is useful when differentiating one factor simplifies it and integrating the other factor is manageable. In x exp(x), take u = x and dv = exp(x) dx. Then du = dx and v = exp(x).

Substitution into the identity gives x exp(x) − ∫exp(x) dx. The remaining integral is exp(x), so the primitive is exp(x)(x − 1) + C. Differentiate the product: exp(x)(x − 1) + exp(x) = x exp(x). The cancellation of the two plain exp(x) terms is the check that the subtraction has the correct sign.

A logarithmic factor suggests a different choice

For x ln(x), take u = ln(x) and dv = x dx. This choice gives du = dx/x and v = x^2/2. The new integral is ∫(x^2/2)(1/x) dx = ∫x/2 dx, which is simpler than the original product on the positive real domain.

The result is (x^2/2)ln(x) − x^2/4 + C. Differentiating the first term gives x ln(x) + x/2; differentiating the subtracted term gives −x/2. The extra terms cancel. The real logarithm still requires x > 0. Finding a primitive has not removed the original domain restriction.

Choose factors for the next integral, not just the first line

A useful parts choice produces a remaining integral that is easier to evaluate. For x exp(x), differentiating x shortens it to 1. Choosing exp(x) as u would preserve an exponential factor while integrating x creates x^2/2, making the next product more complicated. I inspect that remaining integral before committing to a choice.

Some problems require repeated parts, a trigonometric identity, partial fractions or a more general substitution. A mnemonic for selecting u is only a starting suggestion; it cannot guarantee progress. If the next integral becomes harder, reconsider the structure. The current browser engine supports selected parts patterns, not every sequence a full computer algebra system might explore.

Differentiate the complete result

  1. Keep parentheses around composite arguments and denominators.
  2. Differentiate every term of the proposed primitive, including its constants and scale factors.
  3. Apply product and chain rules before simplifying.
  4. Compare with the original integrand on its real domain.
  5. Add C only after you have checked the nonconstant part.

A sampled derivative check can expose an error in a scale factor or sign. It cannot establish that two expressions agree everywhere, especially near excluded points. I use the calculator’s samples as a quick check and the derivative calculation as the explanation. Two primitives differing by a constant can both be valid, so comparing their visible forms alone may be misleading.

A recognized pattern is different from a general method

The integral calculator recognizes linear substitutions and specific elementary products. The nonlinear substitution 2x cos(x^2) above demonstrates the method mathematically; it is not promised as a symbolic match in this limited engine. When a formula is unsupported, a finite definite calculation can still try a labelled numerical estimate.

Keep that boundary in mind when practicing. A failed pattern match does not prove that an elementary answer is impossible. For interpreting a definite result, continue with signed area and reversed bounds. Before applying endpoint subtraction, inspect domain and numerical checks. Choosing a method does not settle those separate questions.

Questions and answers

Does every product need integration by parts?

No. A product may contain an inner function’s derivative and be better handled by substitution.

Why divide by the slope in a linear substitution?

If u = ax+b, then du = a dx. For a nonzero constant a, dx = du/a introduces that factor.

Does the tool recognize every substitution shown in this guide?

No. The nonlinear substitution example explains the mathematical method. The current symbolic engine supports a limited set of patterns, including linear substitutions.

Open the integral calculator

More learn