🧮 Brain Teaser

Integral of (x−1)2/(2ex+x2+1)(x-1)^2 / (2e^x + x^2 + 1)

Problem

Compute: ∫(x−1)22ex+x2+1 dx\int \frac{(x-1)^2}{2e^x + x^2 + 1}\, dx


Field

Integration / Calculus

Why It's Beautiful

The integrand looks completely intractable — an ugly mix of exe^x and a polynomial in both numerator and denominator. There's no obvious substitution and no standard form. Yet the answer is a clean closed form, found by a single algebraic observation.

The trick reveals that the "ugly" denominator was specifically crafted so its derivative nearly matches the numerator. This is a hallmark of integration bee problems: disguise a logarithmic derivative behind an intimidating face.

Key Idea / Trick

Let D=2ex+x2+1D = 2e^x + x^2 + 1. Compute D′=2ex+2xD' = 2e^x + 2x.

Then observe: (x−1)2D=x2−2x+1D=(2ex+x2+1)−(2ex+2x)D=1−D′D\frac{(x-1)^2}{D} = \frac{x^2 - 2x + 1}{D} = \frac{(2e^x + x^2 + 1) - (2e^x + 2x)}{D} = 1 - \frac{D'}{D}

The integrand is just 1−D′/D1 - D'/D, which integrates immediately to x−ln⁡D+Cx - \ln D + C.

Difficulty

2 / 5

Tags

Integration, Logarithmic derivative, Integration bee, Algebraic manipulation, Recognition trick

Logarithmic derivativeIntegration beeAlgebraic manipulation

Integral of (x−1)2/(2ex+x2+1)(x-1)^2 / (2e^x + x^2 + 1) — Answer

Answer

∫(x−1)22ex+x2+1 dx=x−ln⁡(2ex+x2+1)+C\int \frac{(x-1)^2}{2e^x + x^2 + 1}\, dx = x - \ln(2e^x + x^2 + 1) + C


Solution

Let D=2ex+x2+1D = 2e^x + x^2 + 1. Compute its derivative: D′=2ex+2xD' = 2e^x + 2x

Now split the numerator: x2−2x+1=(2ex+x2+1)⏟D−(2ex+2x)⏟D′x^2 - 2x + 1 = \underbrace{(2e^x + x^2 + 1)}_{D} - \underbrace{(2e^x + 2x)}_{D'}

So: (x−1)2D=D−D′D=1−D′D\frac{(x-1)^2}{D} = \frac{D - D'}{D} = 1 - \frac{D'}{D}

Therefore: ∫(x−1)22ex+x2+1 dx=∫(1−D′D)dx=x−ln⁡∣D∣+C\int \frac{(x-1)^2}{2e^x + x^2 + 1}\, dx = \int \left(1 - \frac{D'}{D}\right) dx = x - \ln|D| + C

=x−ln⁡(2ex+x2+1)+C= \boxed{x - \ln(2e^x + x^2 + 1) + C}

(No absolute value needed since 2ex+x2+1>02e^x + x^2 + 1 > 0 for all x∈Rx \in \mathbb{R}.)


Verification

Differentiate x−ln⁡(2ex+x2+1)x - \ln(2e^x + x^2 + 1):

ddx[x−ln⁡(2ex+x2+1)]=1−2ex+2x2ex+x2+1=(2ex+x2+1)−(2ex+2x)2ex+x2+1=x2−2x+12ex+x2+1=(x−1)22ex+x2+1✓\frac{d}{dx}\left[x - \ln(2e^x + x^2 + 1)\right] = 1 - \frac{2e^x + 2x}{2e^x + x^2 + 1} = \frac{(2e^x + x^2 + 1) - (2e^x + 2x)}{2e^x + x^2 + 1} = \frac{x^2 - 2x + 1}{2e^x + x^2 + 1} = \frac{(x-1)^2}{2e^x + x^2 + 1} \checkmark


The Meta-Trick

The integrand was engineered so that:

numerator=denominator−derivative of denominator\text{numerator} = \text{denominator} - \text{derivative of denominator}

Whenever you see an integral of the form ∫f(x)g(x) dx\int \frac{f(x)}{g(x)}\,dx where the denominator is a sum and the numerator looks "close" to the denominator, try computing g′(x)g'(x) and writing f=g−g′f = g - g' (or some linear combination). This immediately gives a 1−g′/g1 - g'/g split integrating to x−ln⁡gx - \ln g.

Type: IntegrationEdit on GitHub ↗