kill(all)$

Maxima : intro computation ,base and acid, 'part :9a,version 1.0'
peter.vlasschaert@gmail.com, 06/12/2018

load 'packages'
------------------------

load(lrats)$

How to solve  : F: OH^3+2.0*10^-9*OH^2-5.0*10^-14*OH-2.0*10^-23=0
========================================================

see :Maxima : intro computation ,base and acid, 'part :9,version 1.0'

find graphical solution. ' see the above function F'.
---------------------------------------------------------------------------

p1:OH^3+2.0*10^-9*OH^2-5.0*10^-14*OH-2.0*10^-23=0;

1e) subst :
=========

p2:OH = z*10^(-7);

p3:lratsubst([p2],p1);

p4:expand(p3);

2e) to find coef highest power z^n , n=3:
------------------------------------------------------------

p5:coeff(lhs(p4),z^3);

3e)  'p4' *1/p5:
---------------------

p6:1/p5*(p4);

symbolic :  a) expand.

p7:expand(p6);

                     b)  float

p7a:float(p7);

fig1 : z 'function':
==============

wxplot2d([lhs(p7a)], [z,0,5],
 [plot_format, xmaxima],grid2d)$

fig2: z 'function' , to narrow the interval for inspection [z,0,5] => [z,2,2.4] :
=============================================================

wxplot2d([lhs(p7a)], [z,2,2.4],
 [plot_format, xmaxima],grid2d)$

check : values 
----------------------

To find all roots , 'p7a'.
===================

p8:allroots(p7a);

find pos value :
------------------------

p8a:p8[2];

To find : [OH(-)]  concentration. ( use : 'p2' ) to find solution 'p1'
-----------------------------------------------------------------------------------------------

from fig 2 : z=2.22
===============

p8b:subst([z=2.22],p2);

check : the solution. 'p8b' into 'p1':
=============================

p8c:subst([p8b],p1);

check : allroots 'Maxima'
-------------------------------------

p9:allroots(p1);

result : easy way to find from graph  :  [OH(-)] = 2.22*10^-7
result :  graphical result ,for programming without symbolic option.