Ask Your Question

# How to substitute a function in a derivative

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 close merge delete

## 1 Answer

Sort by » oldest newest most voted

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)
True

more

## Comments

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

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

sage: var("z")
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...

## Your Answer

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

Add Answer

## Stats

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

Seen: 65 times

Last updated: Sep 21 '19