for my comp. sci. homework i need to create a function that takes the 2 following lines:

y=ax + bx^2 +c

y=ex+f

and find their intercepts. Im thinking i put the 2 equations equal to each other and solve for x. I get

x=sqrt((f-c)/b+a-e)

when i try this however its not right, my calculator is giving me a different answer. Any ideas? thanks!