Solving Equation A & B: Mathematica Procedure

In summary, the conversation involves finding 5 roots for two equations using Mathematica and discussing different approaches and solutions. There is also a suggestion to use the TeXForm command for easier output. The conversation ends with a tip for solving the equations using trigonometry.
  • #1
vp43
1
0
Here is my problem: I got A right, but B is wrong... Can point out what I'm doing wrong? Thanks!

Develop a Mathematica procedure to find 5 roots of the following equations.

a.) x^5 + 5x^4 + 4x^3 + 3x^2 + 2x + 1 = 0

b.) e^x sin^2 x - cos x = 0

For part A, I got NSolve[x^5 + 5x^4 + 4x^3 + 3x^2 + 2x + 1 == 0, x]

And got 5 roots of the following:
{{x -> -4.19273}, {x -> -0.564099 -
0.390903 \[ImaginaryI]}, {x -> -0.564099 + 0.390903 \[ImaginaryI]}, {x -> \
0.160462\[InvisibleSpace] - 0.693272 \[ImaginaryI]}, {x -> 0.160462\
\[InvisibleSpace] + 0.693272 \[ImaginaryI]}}

But for part B, I did the procedure:

FindRoot[E^x Sin^2 x - Cos x == 0, x]

And gave me: FindRoot::fdss: Search specification x should be a list with a 2-5 elements. (FindRoot[\[ExponentialE]\^x\ Sin\^2\ x - Cos\ x == 0, x]\)

~TRI~
 
Physics news on Phys.org
  • #2
You might also be interested in the TeXForm command if you're going to be posting output from Mathematica much. That way, you only need put in the [ tex ] and [ /tex ] tags.

[tex]\{ \{ {x\rightarrow {-2.96732}}\} ,
\{ {x\rightarrow {-0.652083 - 0.707484\,\imag }}\} ,
\{ {x\rightarrow {-0.652083 + 0.707484\,\imag }}\} ,
\{ {x\rightarrow {0.135744 - 0.587885\,\imag }}\} ,
\{ {x\rightarrow {0.135744 + 0.587885\,\imag }}\} \}[/tex]

is output from

NSolve[x^5 + 5x^4 + 4x^3 + 3x^2 + 2x + 1 == 0, x] // TeXForm

or

TeXForm[NSolve[x^5 + 5x^4 + 4x^3 + 3x^2 + 2x + 1 == 0, x]]

--J
 
  • #3
What you do is replace sin^2(x) by 1-cos^2(x) and you get the DE:
e^x cos^2(x) +cos(x)==e^x,

using the Solve function on Mathematica, BUT don't solve in terms of x solve for Cos[x]
i.e: Solve[e^x cos^2(x) +cos(x)==e^x, Cos[x] ]

You then get solutions in terms of Cos[x], which you can then solve trigonometrically, the reason Mathematica doesn't like the equation is because the there are infintite solutions, and the Solve function can't handle these.

Hope this helps
Ray
 

Related to Solving Equation A & B: Mathematica Procedure

What is Mathematica Procedure?

Mathematica Procedure is a computer program used for advanced mathematical calculations and solving equations. It is commonly used by scientists and mathematicians for its powerful computational capabilities.

What is the process of solving equations using Mathematica Procedure?

The process of solving equations using Mathematica Procedure involves entering the equations into the program, specifying the variables and constants, and then using the built-in functions and algorithms to solve the equations and obtain the desired results.

Can Mathematica Procedure solve any type of equation?

Yes, Mathematica Procedure is designed to handle a wide range of equations, including linear, quadratic, polynomial, trigonometric, exponential, and many more. It can also solve systems of equations and differential equations.

How accurate are the solutions provided by Mathematica Procedure?

The solutions provided by Mathematica Procedure are highly accurate and reliable, as the program uses advanced algorithms and numerical methods to obtain precise results. However, it is always advisable to double-check the solutions for any potential errors.

Is Mathematica Procedure user-friendly for beginners?

While Mathematica Procedure may seem intimidating at first, it offers a user-friendly interface and provides detailed documentation and tutorials to help beginners get started. With some practice and familiarity, anyone can use Mathematica Procedure to solve equations and perform complex mathematical calculations.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
313
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
496
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
Back
Top