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

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

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

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

syms x

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

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

Figure contains an axes. The axes contains an object of type functionline.

Чтобы найти горизонтальную асимптоту, вычислите пределы 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])

Figure contains an axes. The axes contains 2 objects of type functionline, line.

Чтобы найти вертикальную асимптоту 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/ (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) ^)/ (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')

Figure contains an axes. The axes contains 3 objects of type functionline, line.

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

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

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)

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

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

Figure contains an axes. The axes contains 4 objects of type functionline, line.

Для просмотра документации необходимо авторизоваться на сайте