I would like to check my solutions for the derivative with the multidimensional chain rule, and I would like to do that online with a calculator. But I can not find one and I do not know how to use wolframalpha for it, which I am sure that it is capable of doing those.

I am talking about tasks like this for example:

$f:\mathbb{R}^2\to\mathbb{R}$, $f(u,v)=u^2+v^2$, $g:\mathbb{R}\to\mathbb{R}^2$, $g(t)=(e^t, t^2)$

And then derive $D(f\circ g)(t)$.

Do you know an online program, which can I use to check my solution, or how I can use wolframalpha for it?

Thanks in advance.


I'm not sure this is exactly what you want, but if not, it should at least give you ideas what to try:

d/dt ReplaceAll[u^2+v^2,{u->e^t,v->t^2}]

  • $\begingroup$ Thank you. Could you also give the code for a more complex composition, like $f:\mathbb{R}^3\to\mathbb{R}$, $f(u,v,w)=uv+vw-uw$ and $g:\mathbb{R}^2\to\mathbb{R}^3$, $g(x,y)=(x+y, x+y^2, x^2+y)$. Then I should be able to understand how the "coding" works. On that example alone, I did not figure out how to do that. $\endgroup$ – Cornman Aug 19 '18 at 20:07
  • 1
    $\begingroup$ @Cornman: That would be ReplaceAll[uv+vw-uw,{u->x+y,v->x+y^2,w->x^2+y}]. You didn't specify a derivative; if you want e.g. $\frac\partial{\partial x}(f\circ g)$, you can put d/dx in front of it. $\endgroup$ – joriki Aug 19 '18 at 20:13
  • $\begingroup$ Does the multivariable chain rule needs this specification in general? Or do you need it just for the online calculation. I hope you understand the question. Having trouble to phrase it I guess... $\endgroup$ – Cornman Aug 19 '18 at 20:20
  • $\begingroup$ @Cornman: I'm afraid I don't :-) $\endgroup$ – joriki Aug 19 '18 at 20:34

You can use the free Wolfram Cloud Sandbox to test these.

D[ u^2 + v^2 /. {u -> Exp[t], v -> t^2}, t]


D[ Function[{u, v}, u^2 + v^2] @@
   Function[t, {Exp[t], t^2}] @ t, t]

or some other possibilites that the Wolfram Language allows.

For another example, try this

Dt[u v + v w - u w /. {u -> x + y, v -> x + y^2,
   w -> x^2 + y}] // Simplify


Dt[Function[{u, v, w}, u v + v w - u w] @@ 
   Function[{x, y}, {x + y, x + y^2, x^2 + y}] @@
   {x, y}] // Simplify

or, again, some other possibilities. If you want a matrix try

{D[#, x], D[#, y]} & @ (u v + v w - u w /.
 {u -> x + y, v -> x + y^2,  w -> x^2 + y}) // Simplify
  • $\begingroup$ Thanks. I tried to solve the example I gave in the comments in the other answer. I tried: D[uv+vw-uw/. {u-> x+y, v-> x+y^2, w-> x^2+y},x,y]. I want the output to be a matrix. Is that possible? $\endgroup$ – Cornman Aug 19 '18 at 22:31
  • $\begingroup$ Why a matrix and what will the entries of the matrix be? Can you give a really simple example? $\endgroup$ – Somos Aug 19 '18 at 22:48
  • $\begingroup$ I seem to confuse something here... When you calculate $D(f\circ g)$ isnt this a matrix in general. In the example I try to solve I expect $D(f\circ g)$ to be a $2\times 1$ matrix, since $f\circ g:\mathbb{R}^2\to\mathbb{R}$. $\endgroup$ – Cornman Aug 19 '18 at 23:06
  • $\begingroup$ Wait, that does not make sense, since it maps onto $\mathbb{R}$. Therefor no matrix. But what if you end up with $f\circ g:\mathbb{R}^3\to\mathbb{R}^3$, isnt the result a matrix/vector? $\endgroup$ – Cornman Aug 19 '18 at 23:08
  • $\begingroup$ No. Do not confuse a function $F: \mathbb{R}^n\to\mathbb{R}^m$ with a $n\times m$ matrix. Maybe you want the Jacobian matrix? $\endgroup$ – Somos Aug 19 '18 at 23:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.