1 | initial version |

Finally I find the solution

```
var("w1,p,w2")
U=function('U')(x)
w2=function('w2')(w1)
U=U(x)
UU=p*U(w1)+(1-p)*U(w2(w1))
difU=solve(diff(UU, w1)==0, diff(w2,w1))
show(difU)
```

But (Notice there is always a but). I want now to specify U. But `subs()`

doesn't work ! How to do this ?

2 | No.2 Revision |

Finally I find the solution

```
var("w1,p,w2")
U=function('U')(x)
w2=function('w2')(w1)
U=U(x)
UU=p*U(w1)+(1-p)*U(w2(w1))
difU=solve(diff(UU, w1)==0, diff(w2,w1))
show(difU)
```

But (Notice there is always a but). I want now to specify U. But `subs()`

doesn't work ! How to do this ~~?~~? Of course, one can always replace `function('U')(x)`

by say `x^a`

without forgetting to eclare `a`

. But I was wondering if there would be a substitution method.

3 | No.3 Revision |

Finally I ~~find the solution~~found a solution:

~~var("w1,p,w2")
U=function('U')(x)
w2=function('w2')(w1)
U=U(x)
UU=p*U(w1)+(1-p)*U(w2(w1))
difU=solve(diff(UU, w1)==0, diff(w2,w1))
~~var("w1, p, w2")
U = function('U')(x)
w2 = function('w2')(w1)
U = U(x)
UU = p*U(w1) + (1 - p) * U(w2(w1))
difU = solve(diff(UU, w1) == 0, diff(w2, w1))
show(difU)

But ~~(Notice ~~(notice there is always a but). I want now to specify ~~U. ~~`U`

. But `subs()`

doesn't ~~work ! ~~work! How to do ~~this ? ~~this? Of course, one can always replace `function('U')(x)`

by say `x^a`

without forgetting to ~~eclare ~~first declare `a`

. But I was wondering if there would be a substitution method.

4 | No.4 Revision |

Finally I found a solution:

```
var("w1, p, w2")
U = function('U')(x)
w2 = function('w2')(w1)
U = U(x)
UU = p*U(w1) + (1 - p) * U(w2(w1))
difU = solve(diff(UU, w1) == 0, diff(w2, w1))
show(difU)
```

But (notice there is always a but). I now want ~~now ~~to specify `U`

. But `subs()`

doesn't work! How to do this? Of course, one can always replace `function('U')(x)`

by say `x^a`

without forgetting to first declare `a`

. But I was wondering if there would be a substitution method.

5 | No.5 Revision |

~~Finally ~~I ~~found ~~have made a ~~solution:~~biog mistake in the precedent solution so as I go slowly here is a part of my new code

~~var("w1, p, w2")
U ~~var("x, y, dx, dy")
V=function('V')(x, y)
V_x = ~~function('U')(x)
w2 ~~diff(V, x)
V_y = ~~function('w2')(w1)
U ~~diff(V, y)
dV = ~~U(x)
UU = p*U(w1) ~~V_x * dx + ~~(1 - p) ~~V_y * ~~U(w2(w1))
difU = solve(diff(UU, w1) == 0, diff(w2, w1))
show(difU)
~~dy
show(dV)
sol=solve(dV==0, dy)
show(sol[0]/dx)
y_x=sol[0].rhs()/dx
show(y_x)
latex(y_x)

But (notice there is always a but). I now want to specify `U`

. But `subs()`

doesn't work! How to do this? Of course, one can always replace `function('U')(x)`

by say `x^a`

without forgetting to first declare `a`

. But I was wondering if there would be a substitution method.

6 | No.6 Revision |

I have made a biog mistake in the precedent solution so as I go slowly here is a part of my new code

```
var("x, y, dx, dy")
V=function('V')(x, y)
V_x = diff(V, x)
V_y = diff(V, y)
dV = V_x * dx + V_y * dy
show(dV)
sol=solve(dV==0, dy)
show(sol[0]/dx)
y_x=sol[0].rhs()/dx
show(y_x)
```~~latex(y_x)
~~

The `show`

commands give successively :

7 | No.7 Revision |

I have made a biog mistake in the precedent solution so as I go slowly here is a part of my new code

```
var("x, y, dx, dy")
V=function('V')(x, y)
V_x = diff(V, x)
V_y = diff(V, y)
dV = V_x * dx + V_y * dy
show(dV)
sol=solve(dV==0, dy)
show(sol[0]/dx)
y_x=sol[0].rhs()/dx
show(y_x)
```

The `show`

commands give successively :

$\mathit{dx} \frac{\partial}{\partial x}V\left(x, y\right) + \mathit{dy} \frac{\partial}{\partial y}V\left(x, y\right)$

$$

8 | No.8 Revision |

I have made a biog mistake in the precedent solution so as I go slowly here is a part of my new code

```
var("x, y, dx, dy")
V=function('V')(x, y)
V_x = diff(V, x)
V_y = diff(V, y)
dV = V_x * dx + V_y * dy
show(dV)
sol=solve(dV==0, dy)
show(sol[0]/dx)
y_x=sol[0].rhs()/dx
show(y_x)
```

The `show`

commands give successively :

$\mathit{dx} \frac{\partial}{\partial x}V\left(x, y\right) + \mathit{dy} \frac{\partial}{\partial y}V\left(x, y\right)$

$\frac{\mathit{dy}}{\mathit{dx}} = -\frac{\frac{\partial}{\partial x}V\left(x, y\right)}{\frac{\partial}{\partial y}V\left(x, y\right)}$

$$

9 | No.9 Revision |

I have made a biog mistake in the precedent solution so as I go slowly here is a part of my new code

```
var("x, y, dx, dy")
V=function('V')(x, y)
V_x = diff(V, x)
V_y = diff(V, y)
dV = V_x * dx + V_y * dy
show(dV)
sol=solve(dV==0, dy)
show(sol[0]/dx)
y_x=sol[0].rhs()/dx
show(y_x)
```

The `show`

commands give successively :

$\mathit{dx} \frac{\partial}{\partial x}V\left(x, y\right) + \mathit{dy} \frac{\partial}{\partial y}V\left(x, y\right)$

$\frac{\mathit{dy}}{\mathit{dx}} = -\frac{\frac{\partial}{\partial x}V\left(x, y\right)}{\frac{\partial}{\partial y}V\left(x, y\right)}$

~~$$~~$-\frac{\frac{\partial}{\partial x}V\left(x, y\right)}{\frac{\partial}{\partial y}V\left(x, y\right)}$

Now I will work on the substitution of the chosen function. And when I will have found I will come back.

10 | No.10 Revision |

~~I have made ~~Here is the code for first and second order implicit differentiation of a ~~biog mistake in the precedent solution so as I go slowly here is a part of my new code~~

`two variables function `#Evaluation of the two first derivatives of an implicit function
var("x, y, dx, ~~dy")
~~dy, al, be")
V=function('V')(x, ~~y)
~~y)# A) either A or B should be uncomment

# V= x^al*y^be# B)

V_x = diff(V, x)
V_y = diff(V, ~~y)
~~y)

# Evaluation of the two first derivatives of an implicit function

var("x, y, dx, dy, al, be")
V=function('V')(x, y)# A) either A or B should be uncomment

# V= x^al*y^be# B)

V_x = diff(V, x)
V_y = diff(V, y)

# Differential

dV = V_x * dx + V_y * dy
~~show(dV)
~~show(dV)

```
# Dérivée du premier ordre
sol=solve(dV==0, dy)
show(sol[0]/dx)
# Dérivée du second ordre
y_x=sol[0].rhs()/dx
show(y_x)
hh=y_x.function(x,y)
y=function('y')(x)
hh_x=diff(hh(x,y),x).full_simplify().subs(diff(y(x), x)==y_x).full_simplify()
show(hh)
show(hh_x)
```

~~ ~~The `show`

commands give successively :

$\mathit{dx} \frac{\partial}{\partial x}V\left(x, y\right) + \mathit{dy} \frac{\partial}{\partial y}V\left(x, y\right)$

$\frac{\mathit{dy}}{\mathit{dx}} = -\frac{\frac{\partial}{\partial x}V\left(x, y\right)}{\frac{\partial}{\partial y}V\left(x, y\right)}$

$-\frac{\frac{\partial}{\partial x}V\left(x, y\right)}{\frac{\partial}{\partial y}V\left(x, y\right)}$

Now I will work on the substitution of the chosen function. And when I will have found I will come back.

` `

` `

` `

` `

```
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.
```