2020-수학-가형-홀수-5¶
문제¶
풀이¶
from sympy import *
x = symbols('x')
y = Function('y')(x)
expr = x**2-3*x*y+y**2-x
d_eq = diff(expr, x)
d_eq
\[\displaystyle - 3 x \frac{d}{d x} y{\left(x \right)} + 2 x + 2 y{\left(x \right)} \frac{d}{d x} y{\left(x \right)} - 3 y{\left(x \right)} - 1\]
roots = solve(d_eq, diff(y, x, 1))
dydx = roots[0]
dydx
\[\displaystyle \frac{2 x - 3 y{\left(x \right)} - 1}{3 x - 2 y{\left(x \right)}}\]
slope = dydx.subs([(x, 1), (Function('y')(x), 0)])
slope
\[\displaystyle \frac{1 - 3 y{\left(1 \right)}}{3 - 2 y{\left(1 \right)}}\]
z = symbols('z')
dydx = dydx.subs(Function('y')(x), z)
slope = dydx.subs([(x, 1), (z, 0)])
slope
\[\displaystyle \frac{1}{3}\]