# Implicit derivatives in one line. How do I do it?

I have this little script to derive implicitly

$PrePrint = # /. {D[y_, x_, NonConstants -> {y_}] :> y'[x]} &;  Example: D[x == y^3 + x y, x, NonConstants -> y]  1 == y + x y'[x] + 3 y^2*y'[x] and then, to obtain the expression for y'[x], I use Solve[1 == y + x y'[x] + 3 y^2*y'[x],y'[x]] //FullSimplify  How can I get all these steps in one line? I'd like to have something like $PrePrint = # /. {D[y_, x_, NonConstants -> {y_}] :> y'[x]} &; //Solve...

• I don't see a question anywhere… – J. M. is in limbo Jul 6 '15 at 0:02
• Look up Dt[]. – J. M. is in limbo Jul 6 '15 at 0:56
• If I saw that, but I want to publish online with the Solve not like having to go to take the result of the derivative and clearance and y '[x] – Fernando Silva Jul 6 '15 at 1:02
• I cannot understand the question at all. You may need a better english translation before posting here. – Jens Jul 6 '15 at 1:19
• Related: (1945), (24422), (52284) – Michael E2 Jul 6 '15 at 4:23

If my interpretation of your question is correct, the following code should produce the desired behaviour.

prePrint[input_] :=
Module[{solveFor},
input /. {D[y_, x_, NonConstants -> {y_}] :> (solveFor = y'[x])} //
If[OwnValues[solveFor] === {}, input, Solve[#, solveFor]] & //
FullSimplify];
\$PrePrint = prePrint;


Test

D[x == y^3 + x y, x, NonConstants -> y]


{{y'[x]] -> (1 - y)/(x + 3 y^2)}}

• if just that is, thank you, sorry for my English – Fernando Silva Jul 6 '15 at 2:02