I’m trying to force Mathematica to implicitly differentiate an ellipse equation of the form:
x^2/a^2+y^2/b^2 == 100
with a = 8 and b = 6.
The command I’m using looks like this:
D[x^2/a^2 + y^2/b^2 == 100/. y -> 3/4*Sqrt[6400-x^2], x]
where, y->3/4*Sqrt[6400-x^2] comes from solving y in terms of x.
I got this far by following the advice found here: http://www.hostsrv.com/webmaa/app1/MSP/webm1010/implicit
Input for this script is the conventional way that an implicit
relationship beween x and y is expressed in calculus textbooks. In
Mathematica you need to make this relationship explicit by using y[x]
in place of y. This is done automatically in the script by replacing
all occurances of y with y[x].
But the solution Mathematica gives does not have y' or dy/dx in it (like when I solved it by hand). So I don’t think it’s been solved correctly. Any idea on what command would get the program to solve an implicit differential? Thanks.
The conceptually easiest option (as you mentioned) is to make
ya function ofxand use the partial derivative operatorD[]But for more complicated relations, it’s best to use the total derivative operator
Dt[]Note that it might be neater to use
SetAttributes[{a, b}, Constant]instead of theSetOptions[Dt, Constants -> {a, b}]command… Then theDtdoesn’t carry around all that extra junk.The final option (that you also mentioned) is to solve the original equation for
y[x], although this is not always possible…And you can check that it satisfies the differential equation we derived above for both solutions
You can substitute your values
a = 8andb = 6anytime with replacement rule{a->8, b->6}.If you actually solve your differential equation
y'[x] == -((b^2 x)/(a^2 y[x])using DSolve with the correct initial condition (derived from the original ellipse equation) then you’ll recover the solution foryin terms ofxgiven above.