Maxima : intro computation ,base and acid, 'appendix 1,version 1.0'
peter.vlasschaert@gmail.com, 10/12/2018

kill(all)$

Load 'packages'
==============
rem :factorout,factorsum,lratsubst

load(lrats)$
load(facexp)$

Maxima : log(x)   =>  math : ln(x)     , ( x > 0)
===================================

base : %e 

p1:exp(1.0);

rem : %e = 2.718281828459045

p1a:log(10.0);

p1b:log(100.0);

convert base : 10
--------------------------

p2:log10(x):= log(x)/log(10);

p2a:log10(100.0),float,numer;

What when  x < 0 :  'complex numer = z = a*%i + b '
---------------------------

p3:log(-1.0);

z = π*%i

p3a:log(-10.0);

z=π*%i +log(10)

p3b:log(-100.0);

z=π*%i +2*log(10) = π*%i + log(100)

p4b: log(-5.0);

p4b1:log(5.0);

z=π*%i + log(5.0)

p4c:log(-2.1);

p4c1:log(2.1);

rem : numerical value of π
---------------------------------------

p4:%pi;

p4a:p4,float,numer;

general :  log(neg real number) =log(-a) = π* %i + log(a), ' a= real '
--------------------------------------------------------------------------------------------------
=> definition :principal value
========================
log(-x) = n*π*%i + log(x) , n=1, x > 0

proof : above .

assume(x>0);

find : a,b
=======

p5:log(-x) = a + b*%i;

p6:exp(lhs(p5))=exp(rhs(p5));

p7:expand(%);

rem : e^(i*θ) = cos(θ) + i*sin(θ)

p8:demoivre(-x=%e^(%i*b+a));

p9:p8/part(rhs(p8),1);

any value a: neg or pos, rhs(p9) < 0 , - real 

p10a : cos(b) = -1;

p10b:solve(p10a,b);

p10c:subst(p10b,sin(b));

rem :

p10d: '%e^(%i*b) = demoivre(%e^(%i*b) );

p10e:subst(p10b,p10d);

p10f:log(p10d);

p10g:subst(p10b,p10f);

find a : ?
=======

p11:subst(p10b,p5);

def : log(x*y) = log(x) + log(y)
========================

p12:log(x*y);

p12a:log(x*y), logexpand=super;

p13:'log(x*y) = p12a;

put y = -1

p14:subst([y=-1],p13);

p15:subst([rhs(p10g)=lhs(p10g)],p14);

 x  = a
log(-a) = a + %i*%pi

General  :
---------------

=========================================================
 log(-x) = log(x)+n*%i*%pi  , n = integer, because lost solution above.
=========================================================