Optimization

Many of the applications of differentiation involve finding a value of x that yields a local maximum or local minimum value of some function f (x). Given the function f (x) = cos x + sin 3x, a plot suggests that there are numerous extreme values .

$\blacktriangleright$ Plot 2D + Rectangular

cos x + sin 3x

dtbpF3in2.0003in0pt

You can locate these extreme values by finding all values x such that f(x) = 0, since the function f (x) = cos x + sin 3x is everywhere differentiable.

$\blacktriangleright$ Solve + Numeric

f(x) = 0, Solution is : $\left\{\vphantom{ x=2.556254693}\right.$x = 2.556254693$\left.\vphantom{ x=2.556254693}\right\}$

This calculation yields only one critical number, although the graph indicates many more. Another strategy is to start with an exact method, then to apply numerical methods to the results.

$\blacktriangleright$ Solve + Exact

f(x) = 0, Solution is : $\left\{\vphantom{ x=2\arctan \left( \rho \right)
}\right.$x = 2 arctan$\left(\vphantom{ \rho }\right.$ρ$\left.\vphantom{ \rho }\right)$$\left.\vphantom{ x=2\arctan \left( \rho \right)
}\right\}$

where ρ is a root of 2Z + 4Z3 +2Z5 -3 + 45Z2 -45Z4 +3Z6

With the insertion point in the expression Z + 4Z3 +2Z5 -3 + 45Z2 -45Z4 +3Z6, click itbpF0.3001in0.3001in0.0701in2dplot.wmf. Set the View Intervals to -5≤x≤5 and -100≤y≤20 for the following view. The graph of this polynomial shows that there are six real roots.

$\blacktriangleright$ Plot 2D + Rectangular

2Z + 4Z3 +2Z5 -3 + 45Z2 -45Z4 +3Z6

itbpF2.0081in1.3353in0in itbpF2.0081in1.3353in0in

With the insertion point in the equation Z + 4Z3 +2Z5 -3 + 45Z2 -45Z4 +3Z6 = 0, from the Solve submenu, choose Numeric. You get the following approximations to the roots of this sixth-degree polynomial. (For this answer, in the Settings box, Digits Used in Display was set at 10.)

$\blacktriangleright$ Solve + Numeric

2Z + 4Z3 +2Z5 -3 + 45Z2 -45Z4 +3Z6 = 0,

Solution is : $\left\{\vphantom{ Z=-4.150985601}\right.$Z = - 4.150985601$\left.\vphantom{ Z=-4.150985601}\right\}$,$\left\{\vphantom{
Z=-.8933542331}\right.$Z = - .8933542331$\left.\vphantom{
Z=-.8933542331}\right\}$,$\left\{\vphantom{ Z=-.3013217637}\right.$Z = - .3013217637$\left.\vphantom{ Z=-.3013217637}\right\}$,

$\left\{\vphantom{ Z=.2409066415}\right.$Z = .2409066415$\left.\vphantom{ Z=.2409066415}\right\}$,$\left\{\vphantom{ Z=1.119376797}\right.$Z = 1.119376797$\left.\vphantom{ Z=1.119376797}\right\}$,$\left\{\vphantom{ Z=3.318711493}\right.$Z = 3.318711493$\left.\vphantom{ Z=3.318711493}\right\}$

You could obtain the roots of this sixth-degree polynomial equally well by choosing Roots from the Polynomials submenu. The corresponding values of x are then given by

x1 = 2 arctan(- 4.150985601) = - 2.668788519

x2 = 2 arctan(- .8933542331) = - 1.458262501

x3 = 2 arctan(- .3013217637) = - .5853379603

x4 = 2 arctan$\left(\vphantom{ .2409066415}\right.$.2409066415$\left.\vphantom{ .2409066415}\right)$ = .4728041346

x5 = 2 arctan$\left(\vphantom{ 1.119376797}\right.$1.119376797$\left.\vphantom{ 1.119376797}\right)$ = 1.683330152

x6 = 2 arctan$\left(\vphantom{ 3.318711493}\right.$3.318711493$\left.\vphantom{ 3.318711493}\right)$ = 2.556254693

Indeed, the absolute minimum f$\left(\vphantom{ -2.668788519}\right.$ -2.668788519$\left.\vphantom{ -2.668788519}\right)$ = - 1.87870685 occurs at x1 = - 2.668788519 (and at x1 +2πn for any integer n), and the absolute maximum f$\left(\vphantom{ \allowbreak
.4728041346}\right.$.4728041346$\left.\vphantom{ \allowbreak
.4728041346}\right)$ = 1.87870685 occurs at x4 = .4728041346 (and at x4 +2πn for any integer n).

Extreme values of cos x + sin 3x can also be found directly. From the Calculus submenu, choose Find Extrema to produce the following.

$\blacktriangleright$ Find Extrema

cos x + sin 3x Candidate(s) for extrema: max$\left(\vphantom{ \cos
\left( 2\arctan \left( \rho \right) \right) +\sin \left( 6\arctan \left(
\rho \right) \right) }\right.$cos$\left(\vphantom{ 2\arctan \left( \rho \right) }\right.$2 arctan$\left(\vphantom{ \rho }\right.$ρ$\left.\vphantom{ \rho }\right)$$\left.\vphantom{ 2\arctan \left( \rho \right) }\right)$ + sin$\left(\vphantom{ 6\arctan \left(
\rho \right) }\right.$6 arctan$\left(\vphantom{ \rho }\right.$ρ$\left.\vphantom{ \rho }\right)$$\left.\vphantom{ 6\arctan \left(
\rho \right) }\right)$$\left.\vphantom{ \cos
\left( 2\arctan \left( \rho \right) \right) +\sin \left( 6\arctan \left(
\rho \right) \right) }\right)$, min$\left(\vphantom{ \cos
\left( 2\arctan \left( \rho \right) \right) +\sin \left( 6\arctan \left(
\rho \right) \right) }\right.$cos$\left(\vphantom{ 2\arctan \left( \rho \right) }\right.$2 arctan$\left(\vphantom{ \rho }\right.$ρ$\left.\vphantom{ \rho }\right)$$\left.\vphantom{ 2\arctan \left( \rho \right) }\right)$ + sin$\left(\vphantom{ 6\arctan \left(
\rho \right) }\right.$6 arctan$\left(\vphantom{ \rho }\right.$ρ$\left.\vphantom{ \rho }\right)$$\left.\vphantom{ 6\arctan \left(
\rho \right) }\right)$$\left.\vphantom{ \cos
\left( 2\arctan \left( \rho \right) \right) +\sin \left( 6\arctan \left(
\rho \right) \right) }\right)$, at $\left\{\vphantom{ \left\{ x=2\arctan \left( \rho \right) \right\}
}\right.$$\left\{\vphantom{ x=2\arctan \left( \rho \right)
}\right.$x = 2 arctan$\left(\vphantom{ \rho }\right.$ρ$\left.\vphantom{ \rho }\right)$$\left.\vphantom{ x=2\arctan \left( \rho \right)
}\right\}$$\left.\vphantom{ \left\{ x=2\arctan \left( \rho \right) \right\}
}\right\}$ where ρ is a root of Z + 4Z3 +2Z5 -3 + 45Z2 -45Z4 +3Z6

The extreme values of y = x3 - 5x + 1 are found similarly.

$\blacktriangleright$ Find Extrema

x3 - 5x + 1 Candidate(s) for extrema:

$\left\{\vphantom{ \frac{10}{9}\sqrt{15}+1,-\frac{10}{9}\sqrt{15}+1}\right.$${\frac{{10}}{{9}}}$$\sqrt{{15}}$ +1, - ${\frac{{10}}{{9}}}$$\sqrt{{15}}$ + 1$\left.\vphantom{ \frac{10}{9}\sqrt{15}+1,-\frac{10}{9}\sqrt{15}+1}\right\}$, at $\left\{\vphantom{ \left\{ x=\frac{1}{3}\sqrt{15}\right\} ,\left\{
x=-\frac{1}{3}\sqrt{15}\right\} }\right.$$\left\{\vphantom{ x=\frac{1}{3}\sqrt{15}}\right.$x = ${\frac{{1}}{{3}}}$$\sqrt{{15}}$$\left.\vphantom{ x=\frac{1}{3}\sqrt{15}}\right\}$,$\left\{\vphantom{
x=-\frac{1}{3}\sqrt{15}}\right.$x = - ${\frac{{1}}{{3}}}$$\sqrt{{15}}$$\left.\vphantom{
x=-\frac{1}{3}\sqrt{15}}\right\}$$\left.\vphantom{ \left\{ x=\frac{1}{3}\sqrt{15}\right\} ,\left\{
x=-\frac{1}{3}\sqrt{15}\right\} }\right\}$

Floating-point coefficients produce floating-point approximations. Thus, applying Find Extrema to x3 - 5.0x + 1.0 gives numerical approximations to the extreme values.

$\blacktriangleright$ Find Extrema

x3 - 5.0x + 1.0 Candidate(s) for extrema:

$\left\{\vphantom{ 5.303314829,-3.303314829}\right.$5.303314829, - 3.303314829$\left.\vphantom{ 5.303314829,-3.303314829}\right\}$, at $\left\{\vphantom{ \left\{
x=-1.290994449\right\} ,\left\{ x=1.290994449\right\} }\right.$$\left\{\vphantom{
x=-1.290994449}\right.$x = - 1.290994449$\left.\vphantom{
x=-1.290994449}\right\}$,$\left\{\vphantom{ x=1.290994449}\right.$x = 1.290994449$\left.\vphantom{ x=1.290994449}\right\}$$\left.\vphantom{ \left\{
x=-1.290994449\right\} ,\left\{ x=1.290994449\right\} }\right\}$

Geometrically, the points $\left(\vphantom{ -1.290994449,5.303314829}\right.$ -1.290994449, 5.303314829$\left.\vphantom{ -1.290994449,5.303314829}\right)$ and $\left(\vphantom{ 1.290994449,-3.303314829}\right.$1.290994449, - 3.303314829$\left.\vphantom{ 1.290994449,-3.303314829}\right)$ represent a high point and a low point, respectively.

$\blacktriangleright$ Plot 2D + Rectangular

x3 - 5x + 1

dtbpF3in2.0003in0pt