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

1 Answer
Jan 31, 2016

Concave: #(-2-sqrt2,-2+sqrt2)#
Convex: #(-oo,-2-sqrt2)uu(-2+sqrt2,+oo)#

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 #f''(x)# is positive and when it is negative. The sign could change from positive to negative or vice versa whenever #f''(x)=0#.

First, we can simplify finding when #f''(x)=0# by recognizing that #e^x# will never equal #0#, since it is always positive. Thus, we must only concern ourselves with the remaining part, #x^2+4x+2#.

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 #(-oo,-2-sqrt2),(-2-sqrt2,-2+sqrt2),# and #(-2+sqrt2,+oo)#.

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 #-2-sqrt2approx-3.414# and #-2+sqrt2approx-0.586#.

#mathbf[(-oo,-2-sqrt2)#

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.

#mathbf[(-2-sqrt2,-2+sqrt2)#

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.

#mathbf[(-2+sqrt2,+oo)#

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 #uu# on a graph and concavity more resembles #nn#.

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 #x=-3#ish and #x=-1/2#ish areas.