# Disregarding the ConditionalExpression in the output of Solve

I am trying to write a program in Mathematica that will perform basic uncertainty analysis for me and "show the work," so to speak. One of the pieces of this program will involve taking in an expression and list of variables, say,

myexpr = w == 2 y Cos[x] + z^2
myvaris = {x, y, z, w}


and solving the expressions for the first variable in the list, e.g.

Solve[myexpr, myvaris[]]


which outputs

{{x -> ConditionalExpression[-ArcCos[(w - z^2)/(2*y)] + 2*Pi*C,
Element[C, Integers]]},
{x -> ConditionalExpression[ArcCos[(w - z^2)/(2*y)] + 2*Pi*C,
Element[C, Integers]]}}


which is all good and correct. But what I would like to obtain is just something like

{x -> ArcCos[(w - z^2)/(2*y)]}


without all the conditional expression business, because its presence wrecks the form of the output I'd like. In particular, what I want in the end is something I can pass to TeXForm which will go into a StringForm to output a chunk of LaTeX. Is it possible to construct something like this (and if so how), or am I asking a question which cannot be solved in pure generality?

To be clear, I'm not asking how to eliminate the particular occurrences of ConditionalExpression in the output above, but to eliminate all instances of such a ConditionalExpression and arbitrary constants in general, without having to manipulate by hand any intermediate results. I'm not really concerned with the output being reliably correct or complete in the end; I just want the expression that a naive high school algebra student would write down.

• You should use Normal. – corey979 Feb 13 '17 at 22:08
• Thanks; that's a bit better but still leaves in the arbitrary constants and produces multiple rules. It's easy enough to just call the first rule and forget the rest, but is there a way to set all arbitrary constants to zero? – Diffycue Feb 13 '17 at 22:12
• Just saw Corey comment. So I deleted my answer. Normal is the recommended way. – Nasser Feb 13 '17 at 22:33

Solve[myexpr,myvaris[],GeneratedParameters->(0&)]

• It's probably better to use: Solve[myexpr,myvaris[],GeneratedParameters->C] /. _C->0 instead. – Carl Woll Feb 13 '17 at 22:30