Is there a simple way to grab or reference one side of an equation?
Minimal example of what I mean:
eq = x^2==3x
(*Pseudo Code*)
in: Grab_lefthandside(eq)
out: x^2
Is there a simple way to grab or reference one side of an equation?
Minimal example of what I mean:
eq = x^2==3x
(*Pseudo Code*)
in: Grab_lefthandside(eq)
out: x^2
You can change Equal to List and you will have the list of left and right hand sides of the equation.
First[List @@ (x^2 == 3 x)]
Part, First, Last, etc. operate on expressions not just a List. There is no need to convert to a List to use them. Try f[a, b, c] // First
– Bob Hanlon
Aug 30 '16 at 15:27
eq[[1]]orFirst@eq– Jason B. Aug 30 '16 at 13:25FullForm[eq]. – Karsten7 Aug 30 '16 at 13:34Parts.Sin[x][[1]] givesx, for instance. EvenGraphicsobjects: look atFullForm[Plot[x, {x, 0, 1}]]`. – march Aug 30 '16 at 16:43