Дифференцирование

В этом примере показано, как аналитически найти и оценить производные с помощью Symbolic Math Toolbox™. В примере вы будете находить 1-ю и 2-ю производную f (x) и использовать эти производные, чтобы найти локальные максимумы, минимумы и точки перегиба.

Первые производные: нахождение локальных минимумов и максимумов

Вычисление первой производной выражения помогает вам найти локальные минимумы и максимумы того выражения. Прежде, чем создать символьное выражение, объявите символьные переменные:

syms x

По умолчанию решения, которые включают мнимые компоненты, включены в результаты. Здесь, рассмотрите только действительные значения x путем установки предположения, что x isreal:

assume(x, 'real')

Как пример, создайте рациональное выражение (т.е. часть, где числитель и знаменатель являются многочленными выражениями).

f = (3*x^3 + 17*x^2 + 6*x + 1)/(2*x^3 - x + 3)
f = 

3x3+17x2+6x+12x3-x+3(3*x^3 + 17*x^2 + 6*x + 1) / (2*x^3 - x + 3)

Графический вывод этого выражения показывает, что выражение имеет горизонтальные и вертикальные асимптоты, локальный минимум между-1 и 0, и локальный максимум между 1 и 2:

fplot(f)
grid

Чтобы найти горизонтальную асимптоту, вычислите пределы f для x приближение к положительным и отрицательным бесконечностям. Горизонтальной асимптотой является y = 3/2:

lim_left = limit(f, x, -inf)
lim_left = 

32sym (3/2)

lim_right = limit(f, x, inf)
lim_right = 

32sym (3/2)

Добавьте эту горизонтальную асимптоту в график:

hold on
plot(xlim, [lim_right lim_right], 'LineStyle', '-.', 'Color', [0.25 0.25 0.25])

Найти вертикальную асимптоту f, найдите полюса f:

pole_pos = poles(f, x)
pole_pos = 

-1634-2414324321/3-34-2414324321/3- 1 / (6* (sym (3/4) - (sqrt (sym (241)) *sqrt (sym (432)))/432) ^sym (1/3)) - (sym (3/4) - (sqrt (sym (241)) *sqrt (sym (432)))/432) ^sym (1/3)

Аппроксимируйте точное решение численно при помощи double функция:

double(pole_pos)
ans = -1.2896

Теперь найдите локальный минимум и максимум f. Если точка является локальным экстремальным значением (или минимум или максимум), первая производная выражения в той точке равна нулю. Вычислите производную f использование diff:

g = diff(f, x)
g = 

9x2+34x+62x3-x+3-6x2-13x3+17x2+6x+12x3-x+32(9*x^2 + 34*x + 6) / (2*x^3 - x + 3) - ((6*x^2 - 1) * (3*x^3 + 17*x^2 + 6*x + 1)) / (2*x^3 - x + 3) ^2

Найти локальные экстремальные значения f, решите уравнение g == 0:

g0 = solve(g, x)
g0 = 

(σ26σ31/6-σ1-1568σ26σ31/6+σ1-1568)where  σ1=3374916331789396323559826+2198209982639304+2841σ31/3σ2578-9σ32/3σ2-361σ22896σ31/6σ21/4  σ2=2841σ31/31156+9σ32/3+361289  σ3=3178939632355176868+2198209530604[sqrt (((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289))) / (6* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/6)) - sqrt ((337491*sqrt (sym (6)) *sqrt ((3*sqrt (sym (3)) *sqrt (sym ('178939632355')))/9826 + sym ('2198209/9826')))/39304 + (2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3) *sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)))/578 - 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) *sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)) - (361*sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)))/289) / (6* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/6) * ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) +, sym (361/289)) ^sym (1/4)) - sym (15/68); sqrt (((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289))) / (6* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/6)) + sqrt ((337491*sqrt (sym (6)) *sqrt ((3*sqrt (sym (3)) *sqrt (sym ('178939632355')))/9826 + sym ('2198209/9826')))/39304 + (2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3) *sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)))/578 - 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) *sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)) - (361*sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)))/289) / (6* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/6) * ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3)),/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)) ^sym (1/4)) - sym (15/68)],

Аппроксимируйте точное решение численно при помощи double функция:

double(g0)
ans = 2×1

   -0.1892
    1.2860

Выражение f имеет локальный максимум в x = 1.286 и локальный минимум в x = -0.189. Получите значения функции в этих точках с помощью subs:

f0 = subs(f,x,g0)
f0 = 

(3σ2-17σ5-σ6+15682-σ4+σ1+1134σ6+2σ2-σ5-21968-σ4+17σ6+σ5-15682+3σ3+σ1-1134σ6-2σ3+σ5-21968)where  σ1=σ7σ91/6σ81/4  σ2=σ5-σ6+15683  σ3=σ6+σ5-15683  σ4=σ8σ91/6  σ5=σ76σ91/6σ81/4  σ6=σ86σ91/6  σ7=3374916331789396323559826+2198209982639304+2841σ91/3σ8578-9σ92/3σ8-361σ8289  σ8=2841σ91/31156+9σ92/3+361289  σ9=3178939632355176868+2198209530604[(3* (sqrt ((337491*sqrt (sym (6)) *sqrt ((3*sqrt (sym (3)) *sqrt (sym ('178939632355')))/9826 + sym ('2198209/9826')))/39304 + (2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3) *sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)))/578 - 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) *sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)) - (361*sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)))/289) / (6* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/6) * ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)) ^sym (1/4)) - sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355'))),/176868 + sym ('2198209/530604')) ^sym (2/3) +, sym (361/289)) / (6* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/6)) + sym (15/68)) ^sym (3) - 17* (sqrt ((337491*sqrt (sym (6)) *sqrt ((3*sqrt (sym (3)) *sqrt (sym ('178939632355')))/9826 + sym ('2198209/9826')))/39304 + (2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')), ^sym (1/3) *sqrt ((, 2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3), + sym (361/289)))/578 - 9* ((sqrt (sym (3)), *sqrt (sym ('178939632355')))/176868, + sym ('2198209/530604')) ^sym (2/3) *sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 +, 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) +, sym (361/289)) - (361*sqrt ((2841* ((, sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3)),/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)))/289) / (6* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 +, sym ('2198209/530604')) ^sym (1/6), * ((2841, * ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 +, sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)), *sqrt (sym ('178939632355')))/176868 +, sym ('2198209/530604')) ^sym (2/3) + sym (361/289)) ^sym (1/4)) - sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3)),/1156 + 9, * ((sqrt (sym (3)), *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)) / (6* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/6)) + sym (15/68)) ^sym (2) - sqrt (((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289))) / ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/6) + sqrt ((337491*sqrt (sym (6)) *sqrt ((3*sqrt (sym (3)) *sqrt (sym ('178939632355')))/9826 + sym ('2198209/9826')))/39304 + (2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3) *sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3)),/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)))/578 - 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) *sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym('2198209/530604')) ^sym (2/3) + sym (361/289)) - (361*sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)))/289) / (((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/6) * ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)) ^sym (1/4)) + sym (11/34)) / (sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)) / (6* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/6)) + 2* (sqrt ((337491*sqrt (sym (6)) *sqrt ((3*sqrt (sym (3)) *sqrt (sym ('178939632355')))/9826 + sym ('2198209/9826')))/39304 + (2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3) *sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)))/578 - 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) *sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868, + sym ('2198209/530604')), ^sym (2/3) + sym (361/289)) - (361*sqrt ((, 2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9, * ((sqrt (sym (3)) *sqrt (sym ('178939632355'))),/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)))/289) / (6* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/6) * ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355'))),/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)) ^sym (1/4)) - sqrt ((2841* ((sqrt (sym (3)), *sqrt (sym ('178939632355')))/176868, + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868, + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)) / (6* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868, + sym ('2198209/530604')) ^sym (1/6)), + sym (15/68)) ^sym (3) - sqrt ((337491*sqrt (sym (6)) *sqrt ((3*sqrt (sym (3)), *sqrt (sym ('178939632355')))/9826 + sym ('2198209/9826')))/39304 + (2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3) *sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)))/578 - 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868, + sym ('2198209/530604')) ^sym (2/3) *sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)) - (361*sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)))/289) / (6* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/6) * ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156, + 9* ((, sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868, + sym ('2198209/530604')), ^sym (2/3) + sym (361/289)) ^sym (1/4)) - sym (219/68)); - (sqrt (((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289))) / ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/6) + 17* (sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)) / (6* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/6)) + sqrt ((337491*sqrt (sym (6)) *sqrt ((3*sqrt (sym (3)) *sqrt (sym ('178939632355')))/9826 + sym ('2198209/9826')))/39304 + (2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3) *sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)))/578 - 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) *sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)) - (361*sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)))/289) / (6* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/6) * ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) +, sym (361/289)) ^sym (1/4)) - sym (15/68)) ^sym (2) + 3* (sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 +, sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 +, sym ('2198209/530604')) ^sym (2/3) + sym (361/289)) / (6* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/6)) +, sqrt ((337491*sqrt (sym (6)) *sqrt ((3*sqrt (sym (3)) *sqrt (sym ('178939632355')))/9826 + sym ('2198209/9826')))/39304 + (2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3), *sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')), ^sym (1/3)),/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)))/578 - 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) *sqrt ((2841, * ((, sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')), ^sym (2/3) + sym (361/289)) - (361*sqrt ((2841* ((, sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3)),/1156 +, 9* ((, sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868, + sym ('2198209/530604')) ^sym (2/3), + sym (361/289)))/289) / (6* ((sqrt (sym (3)), *sqrt (sym ('178939632355')))/176868 +, sym ('2198209/530604')) ^sym (1/6) * ((2841, * ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')), ^sym (1/3))/1156 + 9, * ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)) ^sym (1/4)) - sym (15/68)) ^sym (3) + sqrt ((337491*sqrt (sym (6)), *sqrt ((3*sqrt (sym (3)) *sqrt (sym ('178939632355'))),/9826 + sym ('2198209/9826'))),/39304 + (2841* ((, sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868, + sym ('2198209/530604')) ^sym (1/3), *sqrt ((, 2841* ((sqrt (sym (3)), *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9, * ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')), ^sym (2/3) + sym (361/289)))/578 - 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) *sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3)),/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355'))),/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)) - (361*sqrt ((2841* ((, sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)))/289) / (((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868, + sym ('2198209/530604')) ^sym (1/6), * ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)) ^sym (1/4)) - sym (11/34)) / (sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)) / (6* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/6)) - 2* (sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)) / (6* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/6)) + sqrt ((337491*sqrt (sym (6)) *sqrt ((3*sqrt (sym (3)) *sqrt (sym ('178939632355')))/9826 + sym ('2198209/9826')))/39304 + (2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3) *sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)))/578 - 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) *sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9, * ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 +, sym ('2198209/530604')) ^sym (2/3) + sym (361/289)) - (361*sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3), + sym (361/289)))/289) / (6* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868, + sym ('2198209/530604')) ^sym (1/6) * ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3)),/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)) ^sym (1/4)) - sym (15/68)) ^sym (3), + sqrt ((, 337491*sqrt (sym (6)) *sqrt ((3*sqrt (sym (3)) *sqrt (sym ('178939632355')))/9826 + sym ('2198209/9826')))/39304 + (2841* ((, sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 +, sym ('2198209/530604')) ^sym (1/3) *sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)) *sqrt (sym ('178939632355'))),/176868 +, sym ('2198209/530604')) ^sym (2/3) +, sym (361/289)))/578 - 9* ((sqrt (sym (3)), *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) *sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((, sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')), ^sym (2/3) + sym (361/289)) - (361*sqrt ((2841* ((sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 +, 9* ((sqrt (sym (3)), *sqrt (sym ('178939632355'))),/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)))/289) / (6* ((, sqrt (sym (3)) *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/6) * ((2841* ((sqrt (sym (3)), *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (1/3))/1156 + 9* ((sqrt (sym (3)), *sqrt (sym ('178939632355')))/176868 + sym ('2198209/530604')) ^sym (2/3) + sym (361/289)), ^sym (1/4)) - sym (219/68))]

Аппроксимируйте точное решение численно при помощи double функция на переменной f0:

double(f0)
ans = 2×1

    0.1427
    7.2410

Добавьте маркеры точки в график в экстремальном значении:

plot(g0, f0, 'ok')

Вторые производные: нахождение точек перегиба

Вычисление второй производной позволяет вам найти точки перегиба выражения. Самый эффективный способ вычислить вторые или производные высшего порядка состоит в том, чтобы использовать параметр, который задает порядок производной:

h = diff(f, x, 2)
h = 

18x+34σ1-26x2-19x2+34x+6σ12-12xσ2σ12+26x2-12σ2σ13where  σ1=2x3-x+3  σ2=3x3+17x2+6x+1(18*x + 34) / (2*x^3 - x + 3) - (2* (6*x^2 - 1) * (9*x^2 + 34*x + 6)) / (2*x^3 - x + 3) ^2 - (12*x* (3*x^3 + 17*x^2 + 6*x + 1)) / (2*x^3 - x + 3) ^2 + (2* (6*x^2 - 1) ^2* (3*x^3 + 17*x^2 + 6*x + 1)) / (2*x^3 - x + 3) ^3

Теперь Упростите тот результат:

h = simplify(h)
h = 

268x6+90x5+18x4-699x3-249x2+63x+1722x3-x+33(2* (68*x^6 + 90*x^5 + 18*x^4 - 699*x^3 - 249*x^2 + 63*x + 172)) / (2*x^3 - x + 3) ^3

Найти точки перегиба f, решите уравнение h = 0. Здесь, используйте числовой решатель vpasolve вычислить приближения с плавающей точкой решений:

h0 = vpasolve(h, x)
h0 = 

(0.578718426554417483196010858601961.8651543689917122385037075917613-1.4228127856020972275345064554049-1.8180342567480118987898749770461i-1.4228127856020972275345064554049+1.8180342567480118987898749770461i-0.46088831805332057449182335801198+0.47672261854520359440077796751805i-0.46088831805332057449182335801198-0.47672261854520359440077796751805i)[vpa ('0.57871842655441748319601085860196'); vpa ('1.8651543689917122385037075917613'); - vpa ('1.4228127856020972275345064554049') - vpa ('1.8180342567480118987898749770461i'); - vpa ('1.4228127856020972275345064554049') + vpa ('1.8180342567480118987898749770461i'); - vpa ('0.46088831805332057449182335801198') + vpa ('0.47672261854520359440077796751805i'); - vpa ('0.46088831805332057449182335801198') - vpa ('0.47672261854520359440077796751805i')]

Выражение f имеет две точки перегиба: x = 1.865 и x = 0.579. Обратите внимание на то, что vpasolve также возвращает сложные решения. Отбросьте тех:

h0(imag(h0)~=0) = []
h0 = 

(0.578718426554417483196010858601961.8651543689917122385037075917613)[vpa ('0.57871842655441748319601085860196'); vpa ('1.8651543689917122385037075917613')]

Добавьте маркеры в график, показывающий точки перегиба:

plot(h0, subs(f,x,h0), '*k')
hold off