Let A be (-a, 0) and B be (0, b).
Since point P divides AB in the ratio 2:3, we have:
$\frac{AP}{PB} = \frac{2}{3}$
Using the distance formula, we can find the lengths of AP and PB:
$AP = \sqrt{(-a+3)^2+(4-4)^2} = \sqrt{a^2-6a+9}$
$PB = \sqrt{(0+3)^2+(b-4)^2} = \sqrt{9+(b-4)^2}$
Substituting the lengths into the ratio equation, we get:
$\frac{\sqrt{a^2-6a+9}}{\sqrt{9+(b-4)^2}} = \frac{2}{3}$
Squaring both sides:
$\frac{a^2-6a+9}{9+(b-4)^2} = \frac{4}{9}$
Cross-multiplying:
$9(a^2-6a+9) = 4[9+(b-4)^2]$
Simplifying:
$a^2-6a+81 = 36+4(b^2-8b+16)$
$a^2-6a+45 = 4b^2-32b+40$
$a^2-6a-4b^2+32b+5 = 0$
Now, we can use the fact that A lies on the X-axis and B lies on the Y-axis to solve for a and b.
Since A lies on the X-axis, its y-coordinate is 0. Substituting this into the equation, we get:
$a^2-6a-4(0)^2+32(0)+5 = 0$
$a^2-6a+5 = 0$
This is a quadratic equation that can be solved using the quadratic formula:
$a = \frac{-b \pm \sqrt{b^2-4ac}}{2a}$
$a = \frac{6 \pm \sqrt{(-6)^2-4(1)(5)}}{2(1)}$
$a = \frac{6 \pm \sqrt{36-20}}{2}$
$a = \frac{6 \pm \sqrt{16}}{2}$
$a = 3 \pm 2$
So, either $a = 1$ or $a = 5$. Since $a$ is the x-coordinate of point A, we have:
$A = (-1, 0)$ or $A = (-5, 0)$
Since B lies on the Y-axis, its x-coordinate is 0. Substituting this into the equation, we get:
$(0)^2-6(0)-4b^2+32b+5 = 0$
$-4b^2+32b+5 = 0$
This is a quadratic equation that can be solved using the quadratic formula:
$b = \frac{-b \pm \sqrt{b^2-4ac}}{2a}$
$b = \frac{-32 \pm \sqrt{(-32)^2-4(-4)(5)}}{2(-4)}$
$b = \frac{-32 \pm \sqrt{1024+80}}{-8}$
$b = \frac{-32 \pm \sqrt{1104}}{-8}$
$b = \frac{-32 \pm 33.23}{-8}$
So, either $b = \frac{1.23}{8}$ or $b = 6.53$. Since $b$ is the y-coordinate of point B, we have:
$B = (0, \frac{1.23}{8})$ or $B = (0, 6.53)$
Therefore, the coordinates of points A and B are $(-1, 0)$ and $(0, \frac{1.23}{8})$, or $(-5, 0)$ and $(0, 6.53)$.