TITLE: Equality/Equivalence of functions
QUESTION [5 upvotes]: When we say something like: 
$$ \frac{dy}{dx} = x$$
we're describing the way a function $y$ changes with respect to $x$. 
To solve the differential equation we integrate both sides. Is there a proper way to do this, or is it simply the case that if have a reliable method to get the correct answer then that's fine. For example:
Method 1:
$$ \int\frac{dy}{dx} dx = \int x \, dx$$
$$ \int dy= \int x \, dx$$
$$ y + c_1 = \frac{x^2}{2} + c_2$$
Method 2: 
$$ \frac{dy}{dx} = x$$
$$ dy = x \, dx$$
$$ \int dy= \int x \, dx$$
$$ y + c_1 = \frac{x^2}{2} + c_2$$
This is the thinking that lead me to the question to the title. 

Why is it okay to integrate both sides of an equation? Are we basing that on the fact that indefinite integration is simply the reverse of differentiation? Will integrating both sides always make sense with continuous, integrable, elementary functions?
Can we integrate without respect to a variable? In method 2 I employed the integration operator on both sides without adding a differential (I know it was already there).
If I write $ y'' + 5xy = 2x^2$, is it acceptable to integrate both sides of the equation with respect to y, or x, and get a valid equality as a result?
When I write: $ xy + y^x = 2x + 3$, maybe this is bad example, but am I stating that the left side is the same as the right side, or am I proposing that there are certain values of x and y that satisfy that equation. 

I'm having sort of a fundamental crisis here. I don't think I was ever properly taught what equality means. If you were, where did you learn it?

REPLY [3 votes]: I will disagree with some of the earlier answers a little.
The way we usually do mathematics equality is really an overloaded operator that depends on where we are working. This might not be trivially obvious right away but consider the $2\in \mathbb{N}$, the $2\in \mathbb{Z}$, the $2\in \mathbb{Q}$, the $2 \in \mathbb{R}$ and the $2\in \mathbb{C}$ as an example. Each of these will under standard constructions be completely different objects. Yet we usually prefer to think of them as identical. I.e. If I write $2=(+2)=(2/1)=(\sqrt{2})^2=2+0i$, I would guess everyone would agree these are equal. Even though there is a decent chance the first $2=\{\{\},\{\{\}\}\}$ the second $2=\{1,\{1,2\}\}$ the third $2=\{(a,b);\;a=2b\wedge a,b\in\mathbb{Z}\}$ the fourth $2=\{x;x<2\wedge\; x\in \mathbb{Q}\}$ and the fifth $2=\{2,\{2,0\}\}$, where the symbols $2$ on the right hand sides of the equations should be understood as being the ones defined one earlier.
To answer your questions in order.
1) If two things are equal and you apply the same function to both of them then the result of the application of the function is still equal. In other words if $a=b$ then $f(a)=f(b)$ whenever $f(a)$ makes sense. Now indefinite integration is not a function (that's why you get one of those nasty $c$'s whenever you integrate. Thus performing indefinite integration does not (necessarily) preserve equality. But it does preserve equality up to an additive constant. If $a=b$ then $\int a\;dt=\int b\;dt+C$ for some constant $C$. If all of this is done over the real numbers that constant is a real number. That's why if you write it as you did the last equation holds. The first two don't hold unless you think of the integrals as representing sets of functions. Here I'm talking about method 1. Method 2 is either a lot of abuse of notation or differential one forms. If the former it's the same as method 1, if the latter I don't want to get into that.
2) You can't really integrate without integrating in respect to a variable. (Well you sort of can since you can integrate with respect to a measure but that's more complex and you still need to have some understanding of what the variables are.)
3) Yes up to the caveats given above. You might get things that won't help much but you can integrate.
4) It is not obvious in general from just that equation what you mean. Given no other information than $xy+y^x=2x+3$ there is little we can do with it. It's sorely underdefined, as are most sentences taken out of context. In all we do we try to fill in context. If I say "Trump beats Hillary," you are certainly not given enough context to know what I'm talking about, maybe I know a guy who beats wife and his name if Trump and hers Hillary, or there is a game in which hillary is a card value and trumps beat it. But you will most likely assume that I prefer the current US president to his rival in last years race, since it's the most likely context (I don't necessarily). 
The same is with $xy+y^x=2x+3$ you might be asserting this is an identity in which case it's just a false statement. But it's more likely that $x$ and $y$ are variables and you are claiming they have this relationship. It is not obvious what values $x$ and $y$ may take though (is this an equation over the integers? rationals? reals? $\mathbb{Z}_5$?)
To answer your last question I learned what $=$ meant over many years starting in elementary school and mostly having grasped it by the end of my undergrad. Where I went to school I feel there weren't too many obstacles placed in my way to get to the correct understanding. From what I've seen of the US school system it seems to go out of it's way to make sure the students never get the idea.