I want to use implicit differentiation to find a dy/dx and d2y/dx2. Usually the solution on paper involves finding a replacement for y' that would eventually simplifies the final answer to some simple function of y.
so, for first and second derivative of x^2+y^2=1: there comes an issue where I got sequence instead of expression and I had to convert it to symbolic expression. which ended up with this :
y = function('y')(x);
f = x^2+y^2==1;
print('f is')
show(f)
df=diff(f,x,1);
show(df)
answer_1 = solve(diff(f,x,1),diff(y,x))
show(answer_1)
equation_1 = symbolic_expression(answer_1)
answer_2 = diff(equation_1 ,x)
show(answer_2)
equation_2 = symbolic_expression(answer_2[0])
show(equation_2.expand())
I couldn't find a way to substitute the "diff(y,x)" with another expression which only contains y which eventually goes to simplifies the expression to -1/y**3. my workaround this issue was converting the equation to strings and replace the strings with what I wanted.
show(symbolic_expression(str(equation_2.rhs()).replace(str(diff(y(x),x)),str(answer_1[0].rhs()))).substitute(solve(f,x**2)).simplify_full())
which is not the right way. please help :).
if you are looking for the source of the problem. it is from Thomas' calculus 11th edition. Exercise 3.6 no 37-42