Different result by hand-differentiaion vs MATLAB diff() function.

조회 수: 2 (최근 30일)
yf
yf 2018년 3월 5일
댓글: Stephen23 2018년 3월 5일
I differentiated the equation, ( K=(y^2 + 2*y + 2)/(y + 1)^2 ), by hand-differentiation and got result, ( -2/(y+1) ) while the result with MATLAB function, ( diff(K, y) ) was, (2*y + 2)/(y + 1)^2 - (2*(y^2 + 2*y + 2))/(y + 1)^3
I don't know why was it and what was the wrong I did.
Please help. Thank you.

채택된 답변

Roger Stafford
Roger Stafford 2018년 3월 5일
편집: Roger Stafford 2018년 3월 5일
Your "hand-differentiation" is not correct! The 'diff' answer is correct but can be simplified to an equivalent -2/(y+1)^3. (Perhaps the latter is what you meant to write?)
  댓글 수: 5
Stephen23
Stephen23 2018년 3월 5일
@yf: considering that Roger Stafford helped you to resolve this issue then you should accept this answer: this is the easiest way for you to show your appreciation to the volunteers who help you on this forum.
Stephen23
Stephen23 2018년 3월 5일
yf's "Answer" moved here:
Hi Mr. Roger Stafford,
I found the problem now. the denominator in the solution manual is actually,
(y^2 + 2*y + 1)^2 = ( (y + 1)^2 )^2
hence is,
(2*y + 2)/(y + 1)^2 - (2*(y^2 + 2*y + 2))/(y + 1)^3 = -2*(y + 1)/(y+1)^4 = -2/(y+1)^3
I made mistake on this point.
Thank you so much for you answer and help.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by