# Should I include constants of integration while solving for the particular integral or not?

While finding the particular integral of an ordinary differential equation, should I add constants of integration or not?

Let's consider an example:

I'm trying to solve $\frac{d^2y}{dx^2} + a^2 y= \sec(ax)$

The solution of this differential equation will be the summation of it's complimentary function and particular integral.

The complimentary function will be C.F = $Ae^{iax}+Be^{-iax}$ because the two roots of $(m^2+a^2)=0$ are $m=ia$ and $m=-ia$.

Then I write the particular integral as:

P.I. = $\frac{1}{\mathrm{D}^2+a^2}\sec(ax) = \frac{1}{2i}(\frac{1}{\mathrm{D}-ia}-\frac{1}{\mathrm{D}+ia})\sec(ax)$.

I then denote $\frac{1}{\mathrm{D}-ia}\sec(ax)$ as $u$ and $\frac{1}{\mathrm{D}+ia}\sec(ax)$ as $v$.

Now, $$(D-ia)u=\sec(ax)\implies \frac{du}{dx} - ia u = \sec(ax)\implies \frac{d}{dx}(ue^{-iax}) = e^{-iax}\sec(ax)$$ $$\implies u= e^{iax}(x + i\frac{\log(\cos(ax))}{a} + C_1)$$

$$(D+ia)v=\sec(ax)\implies \frac{dv}{dx} + ia v = \sec(ax)\implies \frac{d}{dx}(ve^{iax}) = e^{iax}\sec(ax)$$ $$\implies v= e^{-iax}(x - i\frac{\log(\cos(ax))}{a} + C_2)$$

Here, I'm not sure whether to include $C_1$ and $C_2$ (constant of integration) or not to.

If I write down the general solution for $y$ (C.F. + P.I.) I get:

$$Ae^{iax}+Be^{-iax} + \frac{1}{2i}\left(e^{iax}(x + i\frac{\log(\cos(ax))}{a} + C_1) - e^{-iax}(x - i\frac{\log(\cos(ax))}{a} + C_2)\right)$$

## As we can see the presence or absence of $C_1$ or $C_2$ will change the general solution drastically!

In the textbook I'm studying from "Introductory Concepts in Differential Equations - Daniel A. Murray", while finding the particular integral they never seem to put in the constants at the end after integration.

See, for example (page 73),

They haven't added any constants of integration for those two underlined integrals! I'm not sure why? Aren't they indefinite integrals? Also, if we don't add the constant of integration, the same integral can give different expressions for the anti-derivative, which differ by a constant. That's exactly the problem I ran into in my previous question.

I'm very confused at this point whether to add the constant of integration or not, while finding the particular integral. Daniel Murray's book doesn't even mention the constants of integration anywhere, while solving for the particular integral.

• The roots of the auxiliary equation are incorrect – Flame Trap Feb 19 '18 at 21:48
• You always should do that. They do that implicitly in the book when they write $y=c_1 e^{3x}+c_2e^{2x}+\frac12 e^{4x}$. The arbitrary constants are your constants of integration. It is especially important when solving DE's to include your constants of integration, or else you can't fit your solution to initial or boundary conditions. – Adrian Keister Feb 19 '18 at 21:50
• The integrals are multiplied by $e^{nx}$ - you don't need your $c_3$ in the comment you made – Mark Bennet Feb 19 '18 at 22:01
• The two you have underlined have multipliers in front of them - which are used to multiply $c_1$ and $c_2$ - which integral does $c_3$ belong to? – Mark Bennet Feb 19 '18 at 22:10
• I have put an answer to split the two. You only need one solution to the particular equation - choose convenient constants. – Mark Bennet Feb 19 '18 at 22:18

First observation: having found the general solution of the homogeneous equation (the complementary function) it is only necessary to find one solution of the specific equation, so the constants of integration can be set to any convenient value eg $0$.