# Is there a way to compute the n-th symbolic derivative of a function where n is also symbolic?

3 visualizzazioni (ultimi 30 giorni)
Matt J il 17 Mar 2024
Modificato: Paul il 17 Mar 2024
Is there a way to compute the n-th symbolic derivative of a function, where n is also a symbolic variable? The following does not seem to work.
syms f(x) x
syms n positive real integer
% Define the function for which you want to find the nth derivative
f(x) = exp(x);
T=diff(f,x,n)
T(x) =
0
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposta accettata

Paul il 17 Mar 2024
Modificato: Paul il 17 Mar 2024
Hi Matt,
I don't think so, at least not using diff
syms f(x) x
syms n positive real integer
% Define the function for which you want to find the nth derivative
f(x) = exp(x);
This line is telling diff to differentiate first wrt to x and then wrt to n, which is why the result is zero.
T=diff(f,x,n)
T(x) =
0
Though I suppose one could ask what it means to differentiate wrt to an integer-valued independent variable.
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Categorie

Scopri di più su Symbolic Math Toolbox in Help Center e File Exchange

R2023b

### Community Treasure Hunt

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

Start Hunting!

Translated by