# For what values of x is #f(x)=x^2e^x# concave or convex?

##### 1 Answer

Concave:

Convex:

#### Explanation:

Concavity and convexity can be determined by the sign of the second derivative of a function:

- If
#f''(a)<0# , then#f(x)# is concave at#x=a# . - If
#f''(a)>0# , then#f(x)# is convex at#x=a# .

Primarily, to find the first derivative, use the product rule.

#f(x)=x^2e^x#

#f'(x)=2xe^x+x^2e^x#

Use the product rule again (twice!) to find the second derivative.

#f''(x)=2e^x+2xe^x+2xe^x+x^2e^x#

#f''(x)=e^x(x^2+4x+2)#

We must now find when

First, we can simplify finding when

The sign of the second derivative could change when

#x^2+4x+2=0#

Use the quadratic equation or complete the square to find that the sign could change at

#x=-2-sqrt2,-2+sqrt2#

Thus, there are three intervals on which there is a distinct concavity, since we know the times when the concavity changes. The three intervals are

We can use one test point from each interval to find the sign of the second derivative and, by extension, the concavity or convexity of each interval.

It may be helpful to note that

Test point:

#x=-4#

#f''(-4)=e^(-4)(16-16+2)=2/e^4# Since this is

#>0# , the interval#(-oo,-2-sqrt2)# is convex.

Test point:

#x=-1#

#f''(-1)=e^(-1)(1-4+2)=-1/e# Since this is

#<0# , the interval#(-2-sqrt2,-2+sqrt2)# is concave.

Test point:

#x=0#

#f''(0)=e^0(0+0+2)=2# Since this is

#>0# , the interval#(-2+sqrt2,+oo)# is convex.

Note that convexity typically resembles

We can consult the graph of the original function:

graph{x^2e^x [-7, 2, -2, 4]}

The concavity does apparently shift twice, both in the