Max Value P
1. **Problem statement:** Given $p = \frac{2}{a^2 + 1} - \frac{2}{b^2 + 1} + \frac{3}{c^2 + 1}$ with $a,b,c > 0$ and the condition $abc + a + c = b$, find the maximum value of $p$.
2. **Rewrite the condition:** From $abc + a + c = b$, rearranged as
$$b = \frac{a + c}{1 - ac}$$
3. **Substitute trigonometric variables:** Let
$$a = \tan \alpha, \quad b = \tan \beta, \quad c = \tan \gamma$$
with $\alpha, \beta, \gamma \in \left(-\frac{\pi}{2}, \frac{\pi}{2}\right)$.
4. **Use tangent addition formula:** Since
$$b = \tan \beta = \tan(\alpha + \gamma)$$
we have
$$\beta = \alpha + \gamma$$
5. **Rewrite $p$ in terms of trigonometric functions:**
$$p = \frac{2}{\tan^2 \alpha + 1} - \frac{2}{\tan^2 (\alpha + \gamma) + 1} + \frac{3}{\tan^2 \gamma + 1}$$
Recall that $1 + \tan^2 x = \sec^2 x$, so
$$\frac{1}{\tan^2 x + 1} = \cos^2 x$$
Thus,
$$p = 2 \cos^2 \alpha - 2 \cos^2 (\alpha + \gamma) + 3 \cos^2 \gamma$$
6. **Use trigonometric identities:** Using the identity
$$\cos^2 x = \frac{1 + \cos 2x}{2}$$
and simplifying, the expression can be transformed to
$$p = 2 \sin(2(\alpha + \gamma)) \sin \gamma + 3 \cos^2 \gamma$$
7. **Set $t = |\sin \gamma|$ and analyze $p$:**
$$p \leq 2t + 3(1 - t^2) = -3 t^2 + 2 t + 3$$
8. **Maximize quadratic in $t$:**
Complete the square:
$$-3 t^2 + 2 t + 3 = -3 \left(t - \frac{1}{3}\right)^2 + \frac{10}{3}$$
The maximum value is
$$p_{\max} = \frac{10}{3}$$
which occurs when
$$\sin(2(\alpha + \gamma)) = 1, \quad \sin \gamma = \frac{1}{3}$$
**Final answer:**
$$\boxed{p_{\max} = \frac{10}{3}}$$