I want to write a function that takes the derivative of f
wrt y1
and then find the root of this derivative when y1
equals y2
. The function f
contains several integrals, y1
, y2
and x
also appear as limits of the integrals. Eventually I would like to be able to vary x
and see how the root changes.
Below is the closest I've gotten, but doesn't work.
fd[x_?NumericQ, y1_?NumericQ, y2_?NumericQ] := D[f[x, y1, y2], y1]
fr[x_?NumericQ, y1_?NumericQ, y10_?NumericQ] :=
y1 /. FindRoot[fd[x, y1, y1]y1]==0, {y1, y10}]
Am I missing a HoldAll condition for y2
in fd
?