#! /usr/bin/env python3

import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import fsolve

x = np.linspace(-2, 2)
y = 3*x**2+4*x-1
y2 = 4*np.log10(x+3)

def f(x):
  return 3*x**2+4*x-1-4*np.log10(x+3)

x1 = fsolve(f, -1.5)
x2 = fsolve(f, 0.5)

print('(%f, %f)'%(x1, x2))

plt.plot(x, y)
plt.plot(x, y2)
plt.plot(x1, 3*x1**2+4*x1-1, 'ro')
plt.plot(x2, 3*x2**2+4*x2-1, 'bs')
plt.show()
