I have an equation of a scalar field in the form
$$f(x, y) = x^2 + y^2 + xy + c$$
I want to find the curvature of the contour of the curve at $f_c = f(0.5, 0.5)$.
So I need to calculate the derivative $\frac{\mathrm dy}{\mathrm dx}$ and $\frac{\mathrm d^2y}{\mathrm dx^2}$
I can solve the equation $f(x, y) = f_c$ and get the derivative of $f(x, y)$ with respect to $x$.
On paper we do,
$$\begin{align*}\frac{d}{dx} f(x,y)&=\frac{d}{dx}(f_c)\\ 2x+2y\frac{dy}{dx}+y+x\frac{dy}{dx}&=0\\\frac{dy}{dx}&=-\frac{2x+y}{x+2y}\end{align*}$$
and further, do $\frac{d}{dx}\left(\frac{dy}{dx}\right)$ for a curvature approximation.
How can I rearrange the equation such that I can get the value of $\frac{dy}{dx}$ on Mathematica?
EDIT: This is what I tried so far:
Clear["Global`*"]
ftest[x_, y_] = x*x + y*y + x*y + c;
dftest = (D[ftest[x, y], x]/D[ftest[x, y], y]);
d2ftest = D[dftest, x];
Solution:
-((2 x + y)/(x + 2 y)^2) + 2/(x + 2 y)
However, this will be wrong as I will be taking the ratio of partials with respect to $x$ and $y$.
y, then differentiate. – b.gates.you.know.what Nov 02 '18 at 10:51ftestfory. – b.gates.you.know.what Nov 02 '18 at 11:09f[x,y]:= x^2 + y^2 + x y - 3/4==0? – Ulrich Neumann Nov 02 '18 at 11:23