- 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.
2 views (last 30 days)
Show older comments
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.
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.
2. Use the diff function to differentiate and definte the symbolic function
3. Use the numden function to obtain symbolic expressions for the numerator and denominator of , and store them in the variables \\\ and \\\ respectively.
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.
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 Comments
Answers (2)
Anshika Chourasia
on 31 Dec 2021
Hi,
Please refer the examples discussed in the below links to get more insights on solving a differential equation:
0 Comments
Walter Roberson
on 31 Dec 2021
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 Comments
See Also
Categories
Find more on Calculus in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!