이 ODE에 대한 두 번째 솔루션이 맞습니까?

Dec 25 2020

Windows 10의 Mathematica V 12.2.이 ODE에 대한 솔루션을 확인하기 위해 Mathematica를 사용하고있었습니다. Mathematica는 두 가지 솔루션을 제공합니다. 두 번째 해결책이 어디에서 왔는지 아십니까? 그리고 맞습니까?

여기 내 솔루션이 있고 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 *)