🧮 Brain Teaser

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

Problem

Compute: (x1)22ex+x2+1dx\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: (x1)2D=x22x+1D=(2ex+x2+1)(2ex+2x)D=1DD\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 1D/D1 - D'/D, which integrates immediately to xlnD+Cx - \ln D + C.

Difficulty

2 / 5

Tags

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

Logarithmic derivativeIntegration beeAlgebraic manipulation

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

Answer

(x1)22ex+x2+1dx=xln(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: x22x+1=(2ex+x2+1)D(2ex+2x)Dx^2 - 2x + 1 = \underbrace{(2e^x + x^2 + 1)}_{D} - \underbrace{(2e^x + 2x)}_{D'}

So: (x1)2D=DDD=1DD\frac{(x-1)^2}{D} = \frac{D - D'}{D} = 1 - \frac{D'}{D}

Therefore: (x1)22ex+x2+1dx=(1DD)dx=xlnD+C\int \frac{(x-1)^2}{2e^x + x^2 + 1}\, dx = \int \left(1 - \frac{D'}{D}\right) dx = x - \ln|D| + C

=xln(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 xRx \in \mathbb{R}.)


Verification

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

ddx[xln(2ex+x2+1)]=12ex+2x2ex+x2+1=(2ex+x2+1)(2ex+2x)2ex+x2+1=x22x+12ex+x2+1=(x1)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=denominatorderivative 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=ggf = g - g' (or some linear combination). This immediately gives a 1g/g1 - g'/g split integrating to xlngx - \ln g.

Type: IntegrationEdit on GitHub ↗