Is there a method to convert the parenthesis of the argument of a function into brackets? What I mean is something like:
$$(x+1)\sin\left(y*\sqrt{y\ln{\left(x^2\right)}}\right)\to(x+1)\sin\left[y*\sqrt{y\ln{\left[x^2\right]}}\right]$$ so that it is evaluatable in mathematica.
To get an idea, I've tried:
function = InputString[];
arg = Row[StringDrop[StringDrop[StringCases[function, "(" ~~ __ ~~ ")"], 1], -1]];
temp = ToString[Row[{"(", arg, ")"}]];
temp2 = ToString[Row[{"[", arg, "]"}]];
ToExpression[StringReplace[function, temp -> temp2]]
which works if the user inputs simple functions like $\sin(x\cdot e^x)$ but fails for a slightly more complicated function such as $(x+1)\sin(x\cdot e^x)$. I want to generalize this if possible to the example above.
ToExpression["(x+1) sin(y*sqrt(ln(x^2)+ 1))", TraditionalForm]
, thoughsqrt
needs a little push. $\endgroup$