# Substitution

After some calculation I arrive to the following equation $\frac{Dp - D+ I}{D(P-1)}$.

Whichever be the command I use I cannot put it as $\frac{D(p - 1)+ I}{D(P-1)}$ or as $1-\frac{I}{D*(P-1)}$ or $1-\frac{I}{D}\frac{1}{(P-1)}$.

This last equation is the one of interest since I would like to solve $1-\frac{I}{D}\frac{1}{(P-1)}==0$ according to $\frac{D}{I}$.

Is there a way to use solve() acording to $\frac{D}{I}$ ? I have tried to substitue x with a form of substitute()for it, but it was an echec. I understand that substitue a ratio of 2 variables for one is a little bit complex.

edit retag close merge delete

Sort by ยป oldest newest most voted

You can add a new variable to model D/I and solve a system of equations :

sage: var('D,P,I,z')
sage: e = (D*P - D + I)/(D*(P - 1))
sage: e
(D*p - D + I)/(D*(P - 1))
sage: solve([e == 0, z == D/I], z, D)
[[z == -1/(P - 1), D == -I/(P - 1)]]

more

Thank tmonteil. When I read your solution I feel stupid. This is so simple.

( 2020-05-18 12:24:11 -0600 )edit

## Stats

Seen: 102 times

Last updated: May 18