Math Help - Help finding the LCD w/variables & exponents in the equation

1. Help finding the LCD w/variables & exponents in the equation

I'm learning how to add and subtract fractions that contain exponents and variables but my book does a horrible job of explaining how you obtain the LCD to solve a given equation. For example, the book lists the following 2 problems to show how it's done but I can't decipher what formula / rule they're using to get the LCD as the book is not very straight forward in explaining the process.
4/x^2 + 7/x

The book gives an LCD of x^2

and

3/xy - 4/y^2

The book gives an LCD of xy^2

If somebody can walk me through these problems I would appreciate the help very much.

2. The least common denominator is the smallest number that has all of the factors of each fraction's denominator. In your example with the fractions $\frac{3}{xy}$ and $\frac{4}{y^2}$, we get from the first fraction that the LCD must have at least one factor of x and one factor of y. From the second fraction, we get that the LCD must have at least two factors of y. So the LCD has at least one factor of x and at least two factors of y. The smallest number that satisfies both of these requirements is $xy^2$.

$\frac{3}{xy} - \frac{4}{y^2} = \frac{3y}{xy^2} - \frac{4x}{xy^2} = \frac{3y - 4x}{xy^2}$.

3. Ok that makes sense, the new LCD must contain all the factors of each fractions denominator which makes the new LCD $XY^2$. Please forgive my ignorance but in this process how is y assigned to 3 and how is x assigned to 4?

4. Ok after further review I understand the process now.

Example:

$3/2x^3 + 6/x = 3/2x^3 + 6 * 2 * x * x/2 * x * x * x * x=3/2x^3 + 12x^2/2x^3 = 3+12x^2/2x^3$

& the explanation: The LCD being 2x^3 we look at $6/x$ and you can see to have 2x^3 we need to multiply the numerator and denominator in $6/x$ by 1 multiple of 2 and 2 more multiples of x which gives us $12x^2/2x^3$