วิธีที่สองของ ODE นี้ถูกต้องหรือไม่?

Dec 25 2020

Mathematica V 12.2 บน windows 10 ฉันใช้ Mathematica เพื่อตรวจสอบโซลูชันของฉันสำหรับ ODE นี้ Mathematica ให้ 2 โซลูชัน ความคิดใดที่วิธีแก้ปัญหาที่สองมาจากไหน? และถูกต้องหรือไม่?

นี่คือคำตอบของฉันและวิธีแก้ปัญหาของ Mathematica

ClearAll[y, x];
ode = y'[x] == 2*Sqrt[1 + y[x]]*Cos[x];
sol = DSolve[{ode, {y[Pi] == 0}}, y, x]

 (* {{y->Function[{x},-2 Sin[x]+Sin[x]^2]},{y->Function[{x},2 Sin[x]+Sin[x]^2]}} *)

เฉพาะโซลูชันที่สองเท่านั้นที่ตรวจสอบ และนั่นคือสิ่งที่ฉันได้รับด้วย คำถามคือ Mathematica ได้รับอันแรกข้างต้นมาได้อย่างไร?

Assuming[Element[x, Reals], Simplify@(ode /. sol[[1]])]
  (* Cos[x] Sin[x] == Cos[x] *)

Assuming[Element[x, Reals], Simplify@(ode /. sol[[2]])]
   (* True *)

วิธีแก้ปัญหาของฉัน: ODE $$ \frac{ \mathop{\mathrm{d}y}}{\mathop{\mathrm{d}x}} = 2 \sqrt{y +1}\, \cos \left(x \right) $$แยกออกจากกันได้ ดังนั้น
\begin{align*} \left(\frac{1}{2 \sqrt{y +1}}\right)\mathop{\mathrm{d}y}&= \cos \left(x \right)\mathop{\mathrm{d}x}\\ \int \left(\frac{1}{2 \sqrt{y +1}}\right)\mathop{\mathrm{d}y}&= \int \cos \left(x \right)\mathop{\mathrm{d}x}\\ \sqrt{y +1} &= c_{1}+\sin \left(x \right) \end{align*} ตอนนี้เงื่อนไขเริ่มต้นถูกใช้เพื่อแก้ปัญหาสำหรับ $c_{1}$. การเปลี่ยนตัว$x=\pi$ และ $y=0$ ในคำตอบข้างต้นให้สมการเพื่อแก้ค่าคงที่ของการรวม \begin{align*} \sqrt{1} &= c_{1} \end{align*} แต่ $\sqrt{1}=1$รับรากหลัก ดังนั้น\begin{align*} c_1 &= 1 \end{align*} การเปลี่ยนตัว $c_{1}$ พบข้างต้นในการแก้ปัญหาทั่วไปให้ $$ \sqrt{y \left(x \right)+1} = \sin \left(x \right)+1 $$ การแก้ปัญหาสำหรับ $y \left(x \right)$ ให้ \begin{align*} y(x)+1 &= (1+\sin(x))^2 \\ y(x)+1 &= (1+\sin^2(x)+2 \sin(x)) \\ y(x) &= \sin^{2}x +2 \sin(x) \end{align*}

จากที่กล่าวมาฉันเห็นว่า Mathematica ต้องได้รับสองคำตอบสำหรับ $c_1$ เช่น $\pm 1$ เมื่อรับ $\sqrt 1$.

จากนั้นจะได้รับสองวิธีนี้ เมื่อไหร่$c_1 = -1$วิธีแก้ปัญหาแรกที่แสดงจะออกมา และเมื่อ$c_1= 1$ทางออกที่สองจะออกมา

วิธีแก้ปัญหาแรกของ Mathematica ถูกต้องหรือไม่? Mathematica ควรได้รับเพียงแค่นั้น$c_1 = 1$ และไม่ $c_1 = \pm 1$เหรอ?

คำตอบ

Vixillator Dec 27 2020 at 09:34
ClearAll[y, x, ode, sol];

(* The given equation ode is a non-linear (quadratic) ODE, which yields two 
   solutions, as expected. Since both solutions satisfy the ODE they are both correct.
   Note that the ODE is equivalent to: y'[x]^2 == 4*(1 + y[x])*Cos[x]^2 *)

ode = y'[x] == 2*Sqrt[1 + y[x]]*Cos[x];
sol = DSolve[{ode, {y[Pi] == 0}}, y[x], x]

(* OUT: {{y[x] -> -2 Sin[x] + Sin[x]^2}, {y[x] -> 2 Sin[x] + Sin[x]^2}} *)

(* In order to obtain a single solution, we need to reduce the ODE to
a quasi-linear ODE, by defining an auxiliary boundary condition, say
at x=0, that will constrain the solution to the one that we seek *)

bcNew = ode /. x -> 0

(* OUT: y'[0] == 2 Sqrt[1 + y[0]] *)

solNew = DSolve[{ode, y[Pi] == 0 && bcNew}, y[x], x]

(* OUT: {{y[x] -> 2 Sin[x] + Sin[x]^2}} *)

(* QED *)