You can use a simple 3.3V / 5V voltage levelshifter or even some transistors to create a 5V signal from a 3.3V signal.

This website has the formulas

Well quite a lot to code

I guess the numeric approximation using newton will be easier to code

p_4(x) shall be the polynomic function p_4(x) = ax^4 + bx^3 + cx^2 + dx + e

and solutions of ax^4 + bx^3 + cx^2 + dx + e = 0

The basic thing is to calculate the slope of a point

slope m = ( p_4(x+h) - p_4(x) ) / h

and use this slope to get a linear function

l(x) = m x + b where b must be calculated from the given point

and then solve the linear equation mx + b = 0 which gives the next approximation for the next iteration until you have an x-value that results in p_4(x) is near to zero

quite some code bt not that complex as you can devide the whole calculation into many easy to code steps

I was looking up newtons method and it is a lot easier than described above

it boils down to

x_n+1 = x_n - f(x_n) / f ' (x_n)

f ' (x) can be calculated with the polynomrule of differentiation

If there is f(x) = ax^n

f ' (x) = a * n * x^(n-1)

or you could do a numerical approximation for f ' (x) with

f ' (x) = [ f(x + h) - f(x) ]/ h

best regards Stefan