# integrating both sides of an equation with $2$ variables

In my book, "Elementary Differential Equations and Boundary Value Problems" $$11$$th ed. Ch $$2.2$$ Example $$2$$ the author integrates both sides of an equation with respect to $$x$$ and $$y$$. To my knowledge if you do something to one side of an equation you have to do the same to the other side of the equation so that the equation still holds. In the example the author integrates one side of the equation with respect to $$x$$ while integrating other side with respect to $$y$$. I could not make sense of it and I couldn't find an online integral calculator that integrates an equation for verification. Can you explain me what is going on?

My calculations for the Eq$$(18)$$ is $$~y - 2 = x^2 + 2x + 2 + c~$$ because integrating $$y$$ terms wrt $$x$$ and $$x$$ terms wrt $$y$$ is going to bring one $$x$$ and one $$y$$ multipliers to the equation.

I hope you understood what I mean. I am waiting for your answers. Thank you!

It is a differential equation of the form $$F(x)\mathrm dx=G(y)\mathrm dy.$$ This means that the differentials are equal. Thus, if you integrate both sides in intervals that correspond, then the integrals as well will be equal. That is, since there's a relationship between $$x$$ and $$y,$$ then as $$x$$ ranges between $$a$$ and $$b,$$ say, we have that $$y$$ also ranges between some values, say $$A$$ and $$B$$ correspondingingly. Then it follows that $$\int_a^bF(x)\mathrm dx=\int_A^BG(y)\mathrm dy,$$ and the fact that the integrands are different, or that the bounds are different, matters not, since in fact, that's what we do when we evaluate integrals by substitution.

The equation is separable that's why the author separate the $$f(x)$$ function part from $$g(y)$$ function. Then he performs integration

Note that you can write the differential equation ( if it's more simple for you) as: $$2(y-1)dy=f(x) dx$$ $$2(y-1)y'=f(x)$$ $$2yy'-2y'=f(x)$$ Since $$(y^2)'=2yy'$$ $$(y^2)'-2y'=f(x)$$ Integrate $$\int ((y^2)'-2y')dx=\int f(x)dx$$ $$\int ( \frac {d(y^2)}{dx}-2 \frac {dy}{dx})dx=\int f(x)dx$$ $$\int d(y^2)-2 \int {dy}=\int f(x)dx$$ $$y^2-2y+c=\int f(x)dx$$ If you integrate a polynomial of degree n, then the degree increase by $$1$$. $$\int f(x)dx=\int 3\color {red} {x^2}+4x+2dx = \color {blue } {x^3}+2x^2+2x+c$$

Note that the written solution, is the standard ODE way of writing concisely the following solution $$2(y(x)-1) y'(x)=3x^2+4x+2$$

Now integrate both sides with respect to $$x$$. $$\int 2(y(x)-1) y'(x) dx =\int 3x^2+4x+2 dx$$

Now, for the Left Hand Side inequality, make the substitution $$y=y(x)$$ (or $$u=y(x)$$). Then $$\int 2(y-1) dy = \int 3x^2+4x+2 dx$$

From here, the rest is the same.

Note that on the LHS, integrating with respect to $$x$$ and then making the substitution $$y=y(x)$$ simply leads to integrating the LHS with respect to $$y$$. Sicne this always happens, we skip the intermediate step.