2
$\begingroup$

Could you help me, please? I'd like to evaluate the following expression:

f' := 1/g[x]

L[x_]:=L[x]=D[f[x]g[x], x]

Thus, I'm expecting to see that

L[x]=1 + f[x]g'[x].

How can I define f' to see this result? Can I do it in such a way that will allow me to keep using "D[]"?

Thank you in advance for your help!

$\endgroup$
1
  • $\begingroup$ Does f' =.; ClearAll[f]; f'[x_] := 1/g[x]; work for you? (Or f /: f' := 1/g[#] &?) Beware that your definition and my first one define a value for Derivative, not f. It has to be cleared with Unset, that is f' =. or f'[x_] =., or Clear[Derivative], which will clear all user-defined Derivative values. $\endgroup$
    – Michael E2
    Commented Apr 19, 2021 at 16:35

1 Answer 1

3
$\begingroup$

What you wrote is almost correct. You just need to changef' := 1/g[x] to f'[x_] := 1/g[x]. Using L[x], you will obtain the desired result

$\endgroup$
1
  • $\begingroup$ Indeed! Thank you! $\endgroup$
    – Svetlana
    Commented Apr 19, 2021 at 17:22

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