MATLAB Answers

difficult inequality to solve

6 views (last 30 days)
bk97 on 25 Jan 2017
Commented: Walter Roberson on 26 Jan 2017
abs((cos(x)+1/2*x^2)-1)*x^4)<=1/24, does anybody have any idea how to solve this on matlab or write down some possible codes?


Sign in to comment.

Accepted Answer

Niels on 25 Jan 2017
Edited: Niels on 25 Jan 2017
since your function is even it is symmetric and it is monotone for x>0 or x<0
use fzero
>> f=@(x)((cos(x)+1./2.*x.^2)-1).*x.^4 - 1/24 % subtract the value to transform it into an issue of roots
>> solution=abs(fzero(f,0))
solution =
>> range=[-solution solution]
range =
-1.0042 1.0042


Walter Roberson
Walter Roberson on 26 Jan 2017
There are an infinity of complex solutions, symmetric in positive and negative real components, and symmetric in positive and negative imaginary components. The boundaries on the imaginary components are +/- -.9958714409867068 approximately and the boundaries on the real components are +/- -1.004205445912837 approximately.
The area is not circular in real and imaginary components, but it is approximately circular.
For any given real component inside the given range, there are two imaginary components that lead to solution; likewise for any given imaginary component within the range, there are two real components that lead to solution.
When I talk about infinity of solutions, I am referring just to the boundary; because if the inequality, everything within the boundary is included too.
The boundary is the solutions for
where a is the real component and b is the imaginary component.
bk97 on 26 Jan 2017
alright thank you for the code about complex value! So could you please tell me if the code with the abs that @Niels has written before does work correctly for real solutions? And what is the conclusion for that
Walter Roberson
Walter Roberson on 26 Jan 2017
The +/- -1.004205445912837 I show occurs when the imaginary component is 0. It is a higher precision version of the value that Niels posted. The code Niels posted is fine.

Sign in to comment.

More Answers (0)


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by