Welcome to Cadabra Q&A, where you can ask questions and receive answers from other members of the community.
0 votes

I have a function of 3 variables F = F(a,b,c),
3 functions of 2 variables A(m,n), B(m,n) and C(m,n)

How do we input this in cadabra?

f(m,n) = F(A(m,n),B(m,n),C(m,n))

I also want to calculate the chain rule (partial derivative) and calculate the 2nd partial derivative.

asked in General questions by

What have you tried so far?

1 Answer

0 votes

\mu,\nu::Coordinate;
a,b,c::Coordinate;
F:=F(a,b,c);
A:=A(\mu,\nu);
B:=B(\mu,\nu);
C:=C(\mu,\nu);
Seems to work

substitute(F, $a -> A$);
substitute(F, $b -> B$);
substitute(F, $c -> C$);
Also seems to work

I tried this example from the site:
https://cadabra.science/manual/PartialDerivative.html

\tau::Coordinate;
\partial{#}::Derivative(\tau);
f::Depends(\tau);
ex:= \partial{f g};
unwrap(ex);

It returns 0 instead of g∂f

answered by (160 points)
...