#Method 1
var('x')
f(x) = x**2 - 3*x + 1
solve([f(x) == 0], x)

#Method 2
from scipy.optimize import fsolve
import numpy as np

def f(x):
    return x**2 - 3*x + 1

fsolve(f, np.random.rand(2))

Kreyszig-example 1; page: 839 (last edited 2010-12-15 12:50:27 by phani)