# Question:Why does dsolve return a solution with a singularity?

## Question:Why does dsolve return a solution with a singularity?

Maple 2015

I don't understand why the solution of sys_2 isn't those of sys_1 when M__p=1 and M__a=0 ?

Traces of the computation seem to indicate that dsolve proceeds exactly the same for sys_2 and sys_1 .

Please note that sol_1 contains a term of the form t*cos(t) that sol_2 doesn't, thus the question: "Is sol_2 correct?"

Could you help me to fix this?
TIA

 > restart
 > infolevel[dsolve] := 4;
 (1)
 > sys_1 := {diff(x(t), t\$2)=sin(t)-x(t), x(0)=0, D(x)(0)=0}; sol_1 := dsolve(sys_1)
 Methods for second order ODEs: --- Trying classification methods --- trying a quadrature trying high order exact linear fully integrable trying differential order: 2; linear nonhomogeneous with symmetry [0,1] trying a double symmetry of the form [xi=0, eta=F(x)] -> Try solving first the homogeneous part of the ODE    checking if the LODE has constant coefficients    <- constant coefficients successful    -> Determining now a particular solution to the non-homogeneous ODE       building a particular solution using variation of parameters <- solving first the homogeneous part of the ODE successful
 (2)
 > sys_2 := {(M__p+M__a)*diff(x(t), t\$2)=M__p*sin(t)-x(t), x(0)=0, D(x)(0)=0}; sol_2 := dsolve(sys_2)
 Methods for second order ODEs: --- Trying classification methods --- trying a quadrature trying high order exact linear fully integrable trying differential order: 2; linear nonhomogeneous with symmetry [0,1] trying a double symmetry of the form [xi=0, eta=F(x)] -> Try solving first the homogeneous part of the ODE    checking if the LODE has constant coefficients    <- constant coefficients successful    -> Determining now a particular solution to the non-homogeneous ODE       building a particular solution using variation of parameters <- solving first the homogeneous part of the ODE successful
 (3)
 > eval(sol_2, [M__p=1, M__a=0])
 >

PS: Already, in the following case, dsolve doesn't return the solution of sys_1.

```sys_3 := {(A+B)*diff(x(t), t\$2)=(A+B)*sin(t)-x(t), x(0)=0, D(x)(0)=0};
sol_3 := dsolve(sys_3)
```

If I do this

```sys_4 := {(A+B)*diff(v(t), t)=(A+B)*sin(t)-x(t), diff(x(t), t)=v(t), x(0)=0, v(0)=0}:
sol_4 := dsolve(sys_4)
```

I get a very complex solution wich contains a piecewise function which separates the cases A+B=1 and A+B<>1.
Evaluating sol_4 for A+B=1 gives the same expression than sys_1:

```simplify(eval(sol_4, A=1-B), trig)
/       1                  1          1         \
{ v(t) = - sin(t) t, x(t) = - sin(t) - - cos(t) t }
\       2                  2          2         /
```

Here is a workaround to get the correct solution of sys_2:

```sys_5 := {(M__P+M__A)*diff(v(t), t)=(M__P+C)*sin(t)-x(t), diff(x(t), t)=v(t), x(0)=0, v(0)=0}:
sol_5 := dsolve(sys_5):
simplify(eval(sol_5, [M__P=1, M__A=0, C=0]), trig)
/       1                  1          1         \
{ v(t) = - sin(t) t, x(t) = - sin(t) - - cos(t) t }
\       2                  2          2         /
```

e

﻿