Error, (in dsolve) y(x) and y cannot both appear in the given ODE
Description
Examples
This error occurs when both yx and y appear in an ordinary differential equation (ODE), resulting in an ambiguous equation which could mean (for instance) that either the ODE y'+y=0 or the ODE y'+constant=0 is used.
Example 1 Specifying an equation containing both the function yt and the constant/parameter y is ambiguous because it is not clear whether the ODE y'+y=0 or y'+constant=0 is intended to be used.
dsolvediffyx,x+y=0
Error, (in dsolve) y(x) and y cannot both appear in the given ODE.
Solution:
Remove the ambiguity by replacing y with yx.
dsolvediffyx,x+yx=0
y⁡x=_C1⁢ⅇ−x
Example 2
Similarly, in the following example, it is unclear whether the ODE is meant to be x2y'−3 x y'+2 y=x2 or x2y'−3 x y'+2 ⋅constant=x2.
ode:=x2⁢ⅆ2ⅆt2⁢y⁡t−3⁢x⁢ⅆⅆt⁢y⁡t+2⁢y=x2
IC ≔ y0 = 7, Dy1 = 2
IC:=y⁡0=7,D⁡y⁡1=2
dsolveode, IC, yt
Error, (in dsolve) y(t) and y cannot both appear in the given ODE.
Remove the ambiguity by replacing y in ode with yt.
ode:=x2⁢ⅆ2ⅆt2⁢y⁡t−3⁢x⁢ⅆⅆt⁢y⁡t+2⁢y⁡t=x2
y⁡t=12⁢x2+12⁢4⁢x−14⁢ⅇ1x+ⅇ1x⁢x2⁢ⅇ2⁢tx2⁢ⅇ2x−ⅇ1x−ⅇtx⁢−14⁢ⅇ2x+x2⁢ⅇ2x+2⁢x2⁢ⅇ2x−ⅇ1x
See Also
dsolve
diff
Download Help Document