Suppose we have this differential equation:
$$ x^2 + y^2 + z^2 = \frac{\frac{\partial y}{\partial x}}{x+y+z}$$
I want to find $\frac{\partial y}{\partial x}$ at x=1,y=1,z=1. I tried this code but doesn't work..
eqn[x_, y_, z_] := x^2 + y^2 + z^2 == D[y[x, z], x]/(x + y + z)
Solve[ eqn[1, 1, 1], D[y[x, z], x] ]
I get an error saying "General::ivar: 1 is not a valid variable."
I restarted mathematica and the error persists.
Too long for a comment - Your answer works, but I improvised this to my current problem and it doesn't seem to work..
Clear["Global`*"]
C1 = 10^(-10);
C2 = 0.1*C1;
R = 50;
Tb = 0.1;
Geb = 5*10^-15;
Z0 = 50;
L[Te_] := 10^-9 + 10^-9*(Te - 0.1);
Zlcr[Te_, w_] := (1/R + 1/(I*L[Te]*w) + I*C1*w)^-1;
Zload[Te_, w_] := -I*w*C2 + Zlcr[Te, w];
\[CapitalGamma][Te_, w_] := (Zload[Te, w] - Z0)/(Zload[Te, w] + Z0);
x[Te_, w_] := Abs[\[CapitalGamma][Te, w]];
y[Te_, w_] := (Abs[\[CapitalGamma][Te, w]])^2;
eqn1 [Te_, Pprobe_, w_] := 1 - 2 Pprobe*D[x[Te, w], Plocal] == Geb*D[Te, Plocal]
a = Solve[eqn1 [Te, Pprobe, w], D[Te, Plocal] ]
b = D[Te, Plocal] /. a
b /. {Te -> 1, Plocal -> 1, w -> 1}
Te
is an undefined symbol, so thatD[Te, Plocal]
immediately evaluates to zero (ie beforeSolve
starts to work on it). You need to tell mathematicaTe
depends onPlocal
, ie. useD[Te[Plocal], Plocal]
, or likely better dont useD
function at all and use a symbol such asdTedPlocal
both in the equation and inSolve
$\endgroup$D[x[Te, w], Plocal]
.x[Te,w]
has no apparent dependency onPlocal
so this is zero, hence your equation as written is just ` 1 + 0 == 0 ` which just evaluates toFalse
$\endgroup$