# What is the antiderivative of the function (g(x)-2)^2 if g(x)=x+e^x+2?

*print*Print*list*Cite

### 2 Answers

The function g(x) = x + e^x + 2

We have to find the anti-derivative of (g(x) - 2)^2

(g(x) - 2)^2

=> (x + e^x + 2 - 2)^2

=> (x + e^x)^2

=> x^2 + e^2x + 2*x*e^x

`int` x^2 + e^2x + 2*x*e^x dx

=> `int`x^2 dx + `int e^(2x) dx + ` `int` 2*x*e^x dx

=> x^3/3 + e^(2x)/2 + (2x - 2)*e^x + C

**The required anti-derivative is x^3/3 + e^(2x)/2 + (2x - 2)*e^x + C**

### User Comments

The antiderivative is the indefinite integral of the function `(g(x)-2)^2 = (x + e^x + 2 - 2)^2 = (x + e^x)^2 = x^2 + 2xe^x + e^(2x)`

We'll integrate both sides:

`int (g(x)-2)^2dx = int x^2dx + 2int xe^xdx + int e^(2x)dx` `int (g(x)-2)^2dx = (x^3)/3 + (e^(2x))/2 + 2int xe^xdx`

`int udv = uv - int vdu`

`` `u = x =gt du = dx`

``

`dv = e^x =gt v = e^x`

`int xe^xdx = xe^x - int e^x dx`

`` `int xe^xdx = xe^x - e^x + C`

**Therefore, the requested antiderivative of the function is:**

**`int (g(x)-2)^2dx = (x^3)/3 + (e^(2x))/2 + 2xe^x - 2e^x + C` **