Ask Your Question

How to substitute a function in a derivative

asked 2019-09-21 14:29:05 +0200

Cyrille gravatar image

I know that if $U(x, y) = A x^\alpha y^\beta$, I have $U_x = \alpha A x^{\alpha-1} y ^\beta$. But by substitution, I can obtain $U_x = \alpha \left(\frac{U}{x}\right)$. Is there a way to obtain this in Sagemath. I have tried

U_x= U.diff(x).subs(Ax^(alpha)y^(beta)== U)

but this has no effect.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-09-21 17:28:12 +0200

Emmanuel Charpentier gravatar image

If I understand you correctly, you meant that $U_x=\frac{\partial U}{\partial x}$, right ? If so, your result is a triviality, since :

  • There exists some quantity $K$ such as $U(x,y)=K x^\alpha$, where $K$ doesn't depend on $x$ (in fact, it is obvious that $K=A y^\beta$).

  • Therefore $\frac{\partial U}{\partial x}=K\frac{\partial x^\alpha}{\partial x}=K\alpha x^{\alpha-1}$

This can be checked in sage quite directly:

sage: U(x,y)=A*x^a*y^b;U
(x, y) |--> A*x^a*y^b
sage: bool(U(x,y).diff(x)==a*U(x,y)/x)
edit flag offensive delete link more


Of course Emmanuel It's trivial. But for students it is not. You propose a verification not a substitution neither a demonstration.

Cyrille gravatar imageCyrille ( 2019-09-21 23:28:47 +0200 )edit

Ah. I see what you mean. Bt that's not substitution per se. What you're trying to do is:

sage: var("z")
sage: solve(U.diff(x)(x,y)==z*U(x,y),z)
[z == alpha/x]

I can't say I find trhis especially illuminating...

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2019-09-22 08:11:10 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2019-09-21 14:29:05 +0200

Seen: 274 times

Last updated: Sep 21 '19