I assume the third term in the first problem should be -7x², not -7x³.
5x⁴ = 5x³•x, and
5x³ (x - 4) = 5x⁴ - 20x³
Subtract this from the dividend to get an initial remainder of
(5x⁴ - 2x³ - 7x² - 39) - (5x⁴ - 20x³) = 18x³ - 7x² - 39
Next, 18x³ = 18x²•x, and
18x² (x - 4) = 18x³ - 72x²
Subtract this from the previous remainder to get a new one of
(18x³ - 7x² - 39) - (18x³ - 72x²) = 65x² - 39
Next, 65x² = 65x•x, and
65x (x - 4) = 65x² - 260x
which gives a new remainder of
(65x² - 39) - (65x² - 260x) = 260x - 39
Next, 260x = 260•x, and
260 (x - 4) = 260x - 1040
which gives a final remainder of
(260x - 39) - (260x - 1040) = 1001
1001 does not divide x, so we're done, and we've shown that
[tex]\dfrac{5x^4-2x^3-7x^2-39}{x-4}=\boxed{5x^3+18x^2+65x+260+\dfrac{1001}{x-4}}[/tex]
A similar process can be used to show
[tex]\dfrac{4x^4+5x-4}{x-2}=\boxed{4x^3+8x^2+16x+37+\dfrac{70}{x-2}}[/tex]