# DSolve Second Order Differential Equation with One Boundary Condition [closed]

So I set up my singular perturbation problem after change of variables for equation and boundary condition. But when using DSolve for the analytical solution, there's always a 1/2 in front of it. Can someone take a look at my set up and tell me what went wrong? Thanks!

singOrd1 = 2 Derivative[1][Y0][X] + (Y0^\[Prime]\[Prime])[X] == 0
bc1YOrd1 = Y0[0] == 0
solSing1 = Y0[X] /. DSolve[{singOrd1, bc1YOrd1}, Y0[X], X][[1]]

• People here generally like users to post code as Mathematica code instead of just images or TeX, so they can copy-paste it. It makes it convenient for them and more likely you will get someone to help you. You may find the meta Q&A, How to copy code from Mathematica so it looks good on this site, helpful Nov 20 '21 at 23:03
• What's wrong with C[1]/2 as a coefficient? Nov 20 '21 at 23:05
• Where is the 1/2 come from? Nov 20 '21 at 23:28
• It's a linear homogeneous system with a homogeneous BC: If $y$ is a solution, then so is $\alpha y$ for any scalar $\alpha$. Someone else's solution may have a different constant multiple than yours, but they're both still correct. One might be able to guess how Mathematica produced a solution with a factor of $1/2$, but I'm not sure what it matters. It just reflects different, valid choices along each solution path. Nov 21 '21 at 1:07
• You can get rid of the $1/2$ by solSing1 /. C[1] -> 2 C[1], if desired. It's a valid transformation, since C[1] is an arbitrary scalar constant. Nov 21 '21 at 1:13

Where is the 1/2 come from?

This is because it is second order ode, and you have one B.C condition.

The general solution generates two constant of integrations.

So it is arbitrary which one of these two is solved for from the one condition given. DSolve choose to solve for C[1]. If you solve for C[2] instead, the 1/2 goes away.

ClearAll[y, x];
ode = 2 y'[x] + y''[x] == 0
bc = y[0] == 0
sol = y[x] /. First@DSolve[ode, y[x], x]

Now apply the BC conditon on the solution

eq = 0 == sol /. x -> 0

Compare the particular solution now when choosing to solve for either constant. Choosing to solve for C[1] gives

sol /. Solve[eq, C[1]]

And Choosing to solve for C[2] gives

sol /. Solve[eq, C[2]]

So both are valid solutions. But it depends on the choice used to solve for the constant of integration. DSolve choose to solve for C[1]. And since the constant that remains is arbitrary, it can be named anything else. say $$C$$. so you end up with any one of these two particular solutions

Both are valid and equivalent solutions since $$C$$ is constant, it does not matter if one writes C or C/2 or C/10 or C/100. After using the second B.C., the same answer will result.