2
$\begingroup$

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...
$\endgroup$
  • $\begingroup$ I don't see a question anywhere… $\endgroup$ – J. M. will be back soon Jul 6 '15 at 0:02
  • $\begingroup$ Look up Dt[]. $\endgroup$ – J. M. will be back soon Jul 6 '15 at 0:56
  • $\begingroup$ 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] $\endgroup$ – Fernando Silva Jul 6 '15 at 1:02
  • 2
    $\begingroup$ I cannot understand the question at all. You may need a better english translation before posting here. $\endgroup$ – Jens Jul 6 '15 at 1:19
  • $\begingroup$ Related: (1945), (24422), (52284) $\endgroup$ – Michael E2 Jul 6 '15 at 4:23
3
$\begingroup$

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.