How to code a function of relative rates

Hello, I have a function
d = sqrt(x^2+y^2)
then
d' = (x.x'+y.y')/sqrt(x^2+y^2)
I tried 2 ways:
1st I do :
syms f(x) f(y)
>> d = sqrt(f(x)^2+f(y)^2)
d =
(f(x)^2 + f(y)^2)^(1/2)
>> diff(d)
ans =
(f(x)*diff(f(x), x))/(f(x)^2 + f(y)^2)^(1/2)
2nd I do
>> diff(d,x,y)
ans =
-(f(x)*f(y)*diff(f(x), x)*diff(f(y), y))/(f(x)^2 + f(y)^2)^(3/2)
but both of the answer are not what I want .
Is there any code lead to the result
(f(x)*diff(f(x), x)+f(y)*diff(f(y), y))/(f(x)^2 + f(y)^2)^(1/2)
What function should i use ?
Thank you !!!

댓글 수: 2

Matt J
Matt J 2021년 1월 2일
편집: Matt J 2021년 1월 2일
but both of the answer are not what I want .
Is it supposed to be clear what answer you do want? The results you've presented seem correct to me.
abc def
abc def 2021년 1월 2일
Is there any code lead to the result
(f(x)*diff(f(x), x)+f(y)*diff(f(y), y))/(f(x)^2 + f(y)^2)^(1/2)

댓글을 달려면 로그인하십시오.

 채택된 답변

Walter Roberson
Walter Roberson 2021년 1월 2일

0 개 추천

syms x y f(t)
d = sqrt(f(x)^2+f(y)^2)
d = 
simplify(diff(d,x) + diff(d,y))
ans = 

댓글 수: 1

abc def
abc def 2021년 1월 2일
편집: abc def 2021년 1월 2일
if i have:
d'=(f(x)*diff(f(x), x)+f(y)*diff(f(y), y))/(f(x)^2 + f(y)^2)^(1/2)
d'=-7sqrt(2)
f(x) = f(y) = 4sqrt(2)
diff(f(x), x) = -8
then can i solve diff(f(y), y) ? Like this
in the image the final line y'=-6 , i type it wrong

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

질문:

2021년 1월 2일

편집:

2021년 1월 2일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by