# Simplify with given equality

Clear[id, kn, vt, vdd, vo];
id = kn*(vi - vt)^2/2;
vo = vdd - id*rd;
Solve[D[vo, vi] == -1, vi]


Output:

{{vi->(1+kn rd vt)/(kn rd)}}


I want to simplify the result with vx=1/(kn*rd). It should be vx+vt. So how to replace with kn*rd with 1/vx?

I try:

Simplify[vi /. Solve[D[vo, vi] == -1, vi][], kn rd == 1/vx]


The result is:

1/(kn rd) + vt


Not vx+vt.

The version is 12.0.0.0.

• Just type Simplify[vi /. Solve[D[vo, vi] == -1, vi][], {kn rd == vx}] gives vt+1/vx (not as you said vx+vt Sep 13, 2022 at 3:54
• What \$Version of Mathematica are you using?
– Syed
Sep 13, 2022 at 3:56
• @Nasser The condition is vx=1/(kn*rd),different from kn rd == vx. Sep 13, 2022 at 4:31
• @cvgmt They wrote So how to replace with kn*rd with vx ? And that is what I used. I did not use the code they had. But what they wrote before it. May be that was a typo then. Sep 13, 2022 at 4:34
• @cvgmt It's a typo. I edited it. Sep 13, 2022 at 14:25

Using Eliminate:

ToRules@Reverse@Eliminate[{vx == 1/(kn*rd), D[vo, vi] == -1}, {kn, rd}]
(*{vi -> vt + vx}*)

• Or maybe Solve[Eliminate[{vx == 1/(kn*rd), D[vo, vi] == -1}, {kn, rd}] , vi]. Sep 13, 2022 at 14:21

Also does give the result 1/(kn rd) + vt instead of vx+vt in Win 11, 13.1 version.

Maybe use another way.

Clear[id, kn, vt, vdd, vo];
id = kn*(vi - vt)^2/2;
vo = vdd - id*rd;
Reduce[{D[vo, vi] == -1, vx == 1/(kn*rd)}, {vi}]
% // Last


rd vx != 0 && kn == 1/(rd vx) && vi == vt + vx.

vi == vt + vx

Or

Solve[{D[vo, vi] == -1, vx == 1/(kn*rd)}, {vi}, {rd}]


{{vi -> vt + vx}}

There are already some excellent answers, but I don't see why not using a replacement rule

id = kn*(vi - vt)^2/2;
vo = vdd - id*rd;
Solve[D[vo, vi] == -1, vi]


and then

Simplify[vi /. Solve[D[vo, vi] == -1, vi]] /. 1/(kn rd) :> vx // First


vt + vx

• Simplify[vi /. Solve[D[vo, vi] == -1, vi]] /. 1/(kn rd) :> vx // First does work, but Simplify[vi /. Solve[D[vo, vi] == -1, vi]] /. (kn rd) :> 1/vx // First doesn't, the result is 1/(kn rd)+vt. Sep 13, 2022 at 14:18
• @Tokubara hi, thanks for your comment. you can try the alternative First@Simplify[vi /. Solve[D[vo, vi] == -1, vi]] /. kn :> 1/(rd vx) which works, right?
– bmf
Sep 13, 2022 at 15:44