# Why does Mathematica just return Hold of my Input? [closed]

Example:

Solve[x^2 + a x + 1 == 0, x]

Output: Hold[Solve[x^2 + a x + 1 == 0, x]]


What is the problem? Any child can solve this in its head

• For me it works. Have you tried stopping the kernel prior to this? – Gladaed Jun 11 '19 at 11:56
• I don't know how but restarting Mathematica solved the problem... Still curious why this happened – OD IUM Jun 11 '19 at 11:58
• You must have assigned some value to x that causes the code to loop. Just like what happens when you assign x = x + 1. – Sjoerd Smit Jun 11 '19 at 13:04

Solve[x^2 + a x + 1 == 0, x]


gives the correct answer. Unless x or a are defined. It is pretty much guaranteed to return the correct answer if you Clear the symbols prior to execution or use a Block.

x = 1
a = 1
Solve[x^2 + a x + 1 == 0, x]


does not work, even if only x is defined. This is actually fairly confusing and might be because the expression does not get properly Hold 'ed. Be Aware!

x = 1
a = 1
Clear[a,x]
Solve[x^2 + a x + 1 == 0, x]


does

x = 1
a = 1
Block[{a, x},
Solve[x^2 + a x + 1 == 0, x]]
{x, a}


does aswell while preserving any potential values of both x and a