4.7 How to replace all abs(expr) by expr
I wanted to replace |expr| by (expr)
One way is
restart;
expr:=u(x) = _C1*exp(-3*x^(1/3)*sqrt(c))*(3*x^(1/3)*sqrt(c) + 1) + _C2*exp(3*x^(1/3)*sqrt(c))*abs(-1 + 3*x^(1/3)*sqrt(c));
\[ u \left (x \right ) = \textit {\_C1} \,{\mathrm e}^{-3 x^{\frac {1}{3}} \sqrt {c}} \left (3 x^{\frac {1}{3}} \sqrt {c}+1\right )+\textit {\_C2} \,{\mathrm e}^{3 x^{\frac {1}{3}} \sqrt {c}} {| -1+3 x^{\frac {1}{3}} \sqrt {c}|} \]
expr:=subsindets(expr,'specfunc( anything, abs )',f->op(f));
\[ u \left (x \right ) = \textit {\_C1} \,{\mathrm e}^{-3 x^{\frac {1}{3}} \sqrt {c}} \left (3 x^{\frac {1}{3}} \sqrt {c}+1\right )+\textit {\_C2} \,{\mathrm e}^{3 x^{\frac {1}{3}} \sqrt {c}} \left (-1+3 x^{\frac {1}{3}} \sqrt {c}\right ) \]