Ask your own question, for FREE!
Differential Equations 17 Online
OpenStudy (unklerhaukus):

\[\frac{\mathrm dy}{\mathrm dx}=\sin(x+y)\]

OpenStudy (unklerhaukus):

\[\newcommand\p \newcommand \p \dd [1] { \,\mathrm d#1 } \p \de [2] { \frac{ \mathrm d #1}{\mathrm d#2} } \begin{align} \de yx &=\sin(x+y) & y(0) &=0 \\ \\ & &\text{let } w&=x+y \\ & & \de wx&=1+\de yx \\ \de wx-1 &=\sin w \\ \de wx &=\sin w+1 \\ \frac{\dd w}{\sin w+1} &=\dd x \\ \int\frac{\dd w}{\sin w+1} &=\int\dd x & &\text{Weierstrass substitution} \\ & &\text{let }t&=\tan\big(\frac w2\big) \\ & &\frac{2\dd t}{1+t^2}&=\dd w \\ & & \frac{2t}{1+t^2}&=\sin w \\ \int\frac1{\frac{2t}{1+t^2}+1}\frac{2\dd t}{1+t^2} &=\int\dd x \\ \int\frac{2\dd t}{2t+1+t^2} &=x+c \\ \int\frac{2\dd t}{(t+1)^2} &=x+c \\ & &\text{let u}&=t+1 \\ & & \dd u &=\dd t \\ \int \frac2{u^2} \dd u &=x+c \\ \frac2{-u} &=x+c \\ -\frac2{t+1} &=x+c \\ -\frac2{\tan\big(\frac w2\big)+1} &=x+c \\ -\frac2{\tan\big(\frac{x+y}2\big)+1} &=x+c & c&=-2 \\ \frac1{\tan\big(\frac{x+y}2\big)+1} &=1-x/2 \\ \tan\Big(\frac{x+y}2\Big)+1 &=\frac1{1-x/2} \\ \tan\Big(\frac{x+y}2\Big) &=\frac{1-(1-x/2)}{1-x/2} \\ \frac{x+y}2 &=\arctan\Big(\frac x{x-2}\Big) \\ y(x) &=2\arctan\Big(\frac x{x-2}\Big)-x \end{align} \]

OpenStudy (aravindg):

Well done! *claps* :)

OpenStudy (unklerhaukus):

i think something is wrong

OpenStudy (unklerhaukus):

im compairing to a forward euler scheme for approximation , and it looks very different

OpenStudy (experimentx):

the technique is fine ... for faster just use this \[ \int \frac{1}{(\sin (x/2) + \cos(x/2))^2}dx = 2\frac{\sin(x/2)}{\sin(x/2) + \cos(x/2)} \] 1/(sin(x) + cos(x))^2 = (sin^2(x) + cos^2(x))/1/(sin(x) + cos(x))^2 = cos(x)(sin(x) + cos(x)) - sin(x)(cos(x) - sin(x))/1/(sin(x) + cos(x))^2 Euler approximation is just an approximation. there is always an error associated with it unless your solution is linear. Use Runge-Kutta methods if you want to get more precise solution.

OpenStudy (experimentx):

1 + sin(x) = (sin(x/2) + cos(x/2))^2

OpenStudy (unklerhaukus):

OpenStudy (unklerhaukus):

@mukushla

OpenStudy (anonymous):

numerical solution contradicts exact solution completely !!!

OpenStudy (unklerhaukus):

where am i going wrong ?

OpenStudy (unklerhaukus):

for some reason i can't even get my matlab plot for the exact value to hit the right intercept

OpenStudy (anonymous):

it's weird, did u see the wolf answer??

OpenStudy (anonymous):

even forth order runge-kutta !!!!

OpenStudy (unklerhaukus):

changin the type of method wont help here, to improve accuracy is eaisier to change the step size, but thats not the problem i am having. my appproximation curve using the euler method is fine, it my exact analtic solution that is wrong

OpenStudy (anonymous):

let me check the exact solution. i'll let you know if i get something different.

OpenStudy (anonymous):

i'm getting\[y=2 \tan^{-1} \frac{x}{2-x} -x\]

OpenStudy (unklerhaukus):

that is good

OpenStudy (anonymous):

in your solution consider last three line, going from first to second it will be \(\frac{x}{2-x}\) not \(\frac{x}{x-2}\)

OpenStudy (anonymous):

rest is fine, i'm curious about the plots now, would you please show the plots

OpenStudy (unklerhaukus):

yeah i still am getting something strange in matlab

OpenStudy (unklerhaukus):

OpenStudy (unklerhaukus):

a differnt graphing program is getting the right results now though

OpenStudy (anonymous):

i can't figure out what's wrong with matlab program :D ???!!! while other one is right !!

OpenStudy (unklerhaukus):

i just found that ``` >> ezplot('y=2*atan(x/(2-x))-x',[0 1]) ``` works

OpenStudy (unklerhaukus):

im not experienced with matlab, but i seem that `plot` and `ezplot` are different computation methods

OpenStudy (unklerhaukus):

i kinda wanted to be able to just `plot`,

OpenStudy (unklerhaukus):

i bet the problem with `plot` in matlab is the same as the problem that wolfram is having

OpenStudy (anonymous):

i lost connection, yeah they must be same !!

OpenStudy (unklerhaukus):

well ive got this now, its working alright, i'd still like some kinda explaination as to what went wrong

OpenStudy (unklerhaukus):

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!