Question from electrostatic, smaller sphere carved out of larger sphere both of uniform charge density Question: The sphere of radius a was filled with positive charge at uniform density $\rho$. Then a smaller sphere of radius $\frac{a}2$ was carved out, as shown in the figure, and left empty. What are the direction and magnitude of electric field at A? At B?

How do I solve this question? The hint given for this question tells us to suppose the uniform charge density of the inner off-center sphere to be -$\rho$. How does that make sense? Isn't it necessary to not  "suppose" things which can't be actually possible?
 A: The great thing about the equations that govern electrostatics is that at long as the boundary conditions are the same, then it doesn't matter what you "suppose". This is in fact why the method of images is so useful at solving certain problems, even if the method isn't describing what is actually happening.
In your case here, yes in reality there is just a hole being carved out. But the equations describing this can't tell the difference between that scenario and the scenario where the hole is actually an equal combination of positive and negative charges. What makes the latter method nicer is that you already know how the electric fields of balls of charge behave, and you know that electric fields follow the law of superposition.
So which would you rather do: integrate vectors over a nontrivial volume (reality), or simpler addition (mathematical/physical trick that gives the same answer)?
A: “Equal positive and negative charge” is not conceptually the same as “no charge”. But the two situations produce the same electric field and that is what matters here.
The field of a positive sphere with a hole is the same as the field of a positive sphere without a hole, plus the field of a negative sphere where the hole was.
Let’s get more mathematical. The relationship between electric field and charge density is that $\nabla\cdot\mathbf{E}$ is proportional to $\rho$. This is a linear relationship and therefore you can superpose solutions. You can “construct” the complicated solution to this equation (for the positive sphere with the hole) by adding two simpler solutions (for a larger positive sphere and a smaller negative sphere). The equation doesn’t “care” whether $\rho$ in some places is zero because there is empty space there, or because there is equal positive and negative charge density there. Zero is zero as far as the equation is concerned.
