- How to create symbolic function
- diff and numden to approximate derivates and extract numerator and denominator respectively
- dsolve to solve differential equations
I'm a beginner in matlab, and I'm not that bright at calculus, can someone answer and explain to me this problem.
3 次查看(过去 30 天)
显示 更早的评论
This is the problem:
In this problem you will use MATLAB to find the critical values of a function. Recall that the critical values of a function
are values of x for which
or
is undefined, In cases where the derivative function \\\\ can be expressed as a fraction
, the critical values of x where either
or
equal 0 and consequently the derivative equals 0 or does not exist.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/820355/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/820360/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/820365/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/820370/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/820375/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/820380/image.png)
Follow the steps to obtain the expressions for the critical value of the function f(x)= x^3/5((4-x)^1/3) :
1. Define the symbolic function
corresponding to the formula above.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/820385/image.png)
2. Use the diff function to differentiate
and definte the symbolic function ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/820395/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/820390/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/820395/image.png)
3. Use the numden function to obtain symbolic expressions for the numerator and denominator of
, and store them in the variables \\\ and \\\ respectively.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/820400/image.png)
4. Use the solve function along with the n and d to obtain the solutions to the equations
and
. Assign them to the variables nzeros and dzeros respectively.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/820405/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/820410/image.png)
This is the code given:
syms x
f(x) = (x^3/5)*((4-x)^1/3)
df(x) = 18/7
[n d] = 0
nzeros = 0
dzeros = 0
%%%%%%% Plotting code below %%%%%%%%
figure; hold on; grid on;
fplot(f(x),'LineWidth',2);
fplot(df(x),'LineWidth',2);
ylim([-6,6]);
legend('$f(x)$','$f''(x)$','Interpreter','latex','FontSize',14);
0 个评论
回答(2 个)
Anshika Chourasia
2021-12-31
Hi,
Please refer the examples discussed in the below links to get more insights on solving a differential equation:
0 个评论
Walter Roberson
2021-12-31
The equation I use here is deliberately different than what you are using, because you are doing homework.
syms x
f(x) = ((x+1)^(2/7))*((2-x)^(2/11))
df(x) = diff(f,x)
[n d] = numden(df)
solve(n)
solve(d)
%%%%%%% Plotting code below %%%%%%%%
figure; hold on; grid on;
fplot(f(x), [-3 3], 'LineWidth',2);
fplot(df(x), [-3 3], 'LineWidth',2);
ylim([-6,6]);
legend('$f(x)$','$f''(x)$','Interpreter','latex','FontSize',14);
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!