Differentiation

11 views (last 30 days)
Richard
Richard on 17 Jan 2012
Commented: Walter Roberson on 20 Dec 2024 at 20:36
Is it possible to construct a code that for example we type in x^2 and then the program finds (d/dx)x^2=0 and gives x=0?
I have tried using syms x; diff(x^2) which gives 2*x but I don't know how to make it solve the equation. Perhaps I have to define a function handle? But f=@(x) diff(x^2) doesn't work.
Please help.

Accepted Answer

Walter Roberson
Walter Roberson on 17 Jan 2012
solve(diff(x^2))
  1 Comment
Richard
Richard on 17 Jan 2012
Thanks, Walter! :-)

Sign in to comment.

More Answers (2)

Wayne King
Wayne King on 17 Jan 2012
syms x
solve(diff(x^2)==0)
  1 Comment
Richard
Richard on 17 Jan 2012
Thanks, Wayne! :-)

Sign in to comment.


Salama
Salama on 18 Dec 2024 at 5:42
I want to learn differential and integral calculus to help me solve problems in quantum physics.
  2 Comments
Walter Roberson
Walter Roberson 3 minutes ago
Integral calculus and differentiation is a large topic. Numerous textbooks have been written on the topic. It is not very related to MATLAB, so asking here is not correct.

Sign in to comment.

Categories

Find more on Programming in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!