# Some questions regarding a differential equation

## Main Question or Discussion Point

Hello,

I am new here. I hope I am posting my problem at the right place.

I need some urgent help regarding the following differential equation:

A$\frac{d^{2}y}{dx^{2}}$+B$\frac{dy}{dx}$=f(x,$\lambda$).......(1)

where, A and B are constants. x and $\lambda$ are independent.

I have solved the equation analytically and the solution is a function of x and $\lambda$, i.e y(x,$\lambda$).

Afterwards, to obtain y(x) [i.e to make it $\lambda$ independent], I have integrated the solution over a region of $\lambda$, i.e $\int{y(x,\lambda)}$d$\lambda$=y(x) ........(2)

My question is - can I integrate the term f(x,$\lambda$) over a region of $\lambda$ before solving the eqn (1)? i.e if I replace f(x,$\lambda$) by $\int{f(x,\lambda)}$d$\lambda$ = f(x) in eqn (1) and solve the following equation:

A$\frac{d^{2}y}{dx^{2}}$+B$\frac{dy}{dx}$=f(x) ............(3)

Is it a correct way to solve (1)?

I have solved the eqn (3). But, the solution (y(x) curve) is completely different than (2).

Which method should I use (first or second method)? Any explanation of getting different results would also help me. Please pardon my ignorance - I am new in this field.