Problems solving some exponentials and trig equations
Subject: Problems solving some exponentials and trig equations
From: Jaime Villate
Date: Sat, 26 May 2012 14:55:06 +0100
Hi Daniel,
On 05/26/2012 11:11 AM, Daniel Dalton wrote:
> I'm doing my final year of high school mathematics, and since I'm vision
> impaired I use maxima as an accessible CAS calculator, which has worked
> really well!
>
> However, lately I've ran into a few problems.
>
> 1) I can not solve exponential equations simultaneously:
> (%i2) solve([2=%e^(0+b)+c,6=%e^(1+b)+c],[b,c]);
You can give solve a little help replacing %e^b by a new variable, for
instance, x:
(%i2) eqs: [2=%e^b+c,6=%e^(1+b)+c];
(%o2) [2 = c+%e^b,6 = c+%e^(b+1)]
(%i3) ratsubst (x,%e^b,eqs);
(%o3) [2 = x+c,6 = %e*x+c]
(%i4) solve(%);
(%o4) [[x = 4/(%e-1),c = (2*%e-6)/(%e-1)]]
And then you substitute x back to %e^b and solve for b:
(%i5) solve(rhs(%[1][1]) = %e^b);
(%o5) [b = log(4/(%e-1))]
>
> Attempt solve by using logs. However, it did not work.
>
> (%i3) solve([0+b+log(c)=log(2),log(6)=1+b+log(c)],[b,c]);
These equations are not equivalent to the first set because you replaced
log(x+y) by log(x)+log(y) which
is not true.
>
> 2) Something a little complicated like this won't solve.
> (%i13) solve(2000*(1-%e^(-0.1*n))-20*n=0);
This is called a "transcendental equation" which cannot be solved
analytically. You can solve it using a numerical
method; some methods need a good initial guess, which can be found
looking at the plot of the expression. In
your case, you can use another method, bracketing the roots, which
consists on finding an interval in which the expression changes sign.
Let's see the value of the expression at n=-1 and n=1
(%i4) f: 2000*(1-%e^(-0.1*n))-20*n$
(%i5) at (f,n=1);
(%o5) 170.325163928081
(%i6) at (f,n=-1);
(%o6) -190.3418361512954
Since there is a sign change, there must be a root in that interval and
you can use "findroot" to find it:
(%i7) find_root(f,-1,1);
(%o7) 0.0
>
> 3) Trig equations, some won't solve. eg.
> solve(sin(x)+cos(x)=sqrt(3)/2+1/2,x);
>
> (%o4) [sin(x) = -(2*cos(x)-sqrt(3)-1)/2]
Use %solve instead of solve, which comes in the additional package
"to_poly_solver"
(%i8) load("to_poly_solver")$
(%i9) %solve(sin(x)+cos(x)=sqrt(3)/2+1/2,x);
(%o9) %union([x = 2*%pi*%z7-%i*(log((sqrt(3)/4+sqrt(2-sqrt(3))/2^(3/2)+1/4)^2
+(sqrt(3)/4-sqrt(2-sqrt(3))/2^(3/2)+1/4)^2)/2
+%i*atan((sqrt(3)/4-sqrt(2-sqrt(3))/2^(3/2)+1/4)
/(sqrt(3)/4+sqrt(2-sqrt(3))/2^(3/2)+1/4)))],
[x = 2*%pi*%z9-%i*(%i*atan((sqrt(3)/4
+sqrt(2-sqrt(3))/2^(3/2)+1/4)/(sqrt(3)/4
-sqrt(2-sqrt(3))/2^(3/2)+1/4))
+log((sqrt(3)/4+sqrt(2-sqrt(3))/2^(3/2)+1/4)^2
+(sqrt(3)/4-sqrt(2-sqrt(3))/2^(3/2)+1/4)^2)/2)])
The operator %union tells you that there are several solutions. The
symbols %z7 and %z9 represent
any arbitrary integer value.
> My other problem which I think I may have already asked about was
> whether the solve function can solve for a given domain? And also
> whether there is any way to get multiple solutions for the trig stuff?
> But it seemed the answer to both those questions was no.
In some cases, %solve allows you to find the multiple solutions.
Regards,
Jaime