on the first you're correct. and let me tell you why.
Pull out the x on top and bottom:
this is the same as:
is one. anything divided by itself is one (except zero).
So you're left with:
But there's another way to think about this, a more easier way.
you can just cancel the x's:
On the second problem, you're wrong.
There's nothing you can factor out on the top and bottom.
but say you had:
now you can pull out factors: