In the form:
##A^2 B^5 + A^3 B^4,##
first look at term A.
There is a power of 2 and a power of 3. The smaller of these is 2, so ##A^2## is a common factor. Factor it out and you have:
##A^2( B^5 + A B^4).##
Next look at term B. Same rules apply, and you have a common factor in the sum of ##B^4.## Factor that out and you have:
##A^2B^4( B + A ).##
If you had coefficients, like 6 and 30, you would do the same thing...find the common factor, factor it out, and leave behind any part that was not factored.
If this is not making sense, please review the distributive property of multiplication...which tells you that:
a(b+c) = ab+ac.
This is what allows you to factor in this way...if you are given something like ab+ac, you can put it in factored form of a(b+c).