• Support PF! Buy your school textbooks, materials and every day products Here!

Double root

  • #1
joshmccraney
Gold Member
1,934
96

Homework Statement


What value of ##p## gives a double root for ##f(x;p) = \cos x - 0.8+px^2##? I'm using python.

Homework Equations


Nothing comes to mind.

The Attempt at a Solution


I was thinking about choosing a window ##p\in[a,b]## such that ##a=0.3## yields 4 roots and ##b=0.4## yields 0 roots. Then cut this interval in half at ##p = b-0.5(a+b)## and evaluate the number of roots of ##f(x;p)=0##. If no root is found then let ##b = p## and reiterate. If a root is found then let ##a = p## and reiterate.

The issue is, every root finder I see doesn't use a good value when no root is found. It returns an error message with an arbitrary value. I need a way to distinguish when a root is found or not...any ideas?
 

Answers and Replies

  • #2
13,114
9,887
How about setting ##f(x;p)=p(x-x_0)^2## and examination of the consequences either by comparison of the terms or differentiation? Not sure how far you get with this approach, but it's an idea.
 
  • #3
Math_QED
Science Advisor
Homework Helper
2019 Award
1,597
641
Could you define double root please?
 
  • Like
Likes joshmccraney
  • #4
joshmccraney
Gold Member
1,934
96
Could you define double root please?
Sorry, I can see I've been somewhat inaccurate. A double root implies the multiplicity of a root is 2. If a double root occurs at ##x=a## for a given ##p##, then ##f(a;p) = f'(a;p) = 0##. This is a necessary condition...

So I just solved it! Following your question I applied the above two equation equalities and out came a good answer!
 
Last edited:
  • Like
Likes Math_QED

Related Threads on Double root

  • Last Post
Replies
6
Views
2K
  • Last Post
Replies
3
Views
985
  • Last Post
Replies
3
Views
908
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
4
Views
3K
Replies
6
Views
2K
  • Last Post
Replies
5
Views
2K
  • Last Post
Replies
7
Views
1K
  • Last Post
Replies
0
Views
891
Top