Write a C program to find a root of $x^3 - 3*x + 1 = 0$ by fixed point iteration method (including...
$begingroup$
The code works fine. But I want to include the convergence criterion which is as follows:
if the equation is written in the form $x=g(x)$, then condition of convergence is: $g'(x)<1$.
Note that: $g(x)=sqrt [3]{3,x-1}$ and $g'(x)=left( 3,x-1 right) ^{-2/3}$
Please modify my code for convergence.
/* g (x) = (3x - l)^(l/3 ), x0=5 */
/* Fixed po int of Iteration Method */
#include<stdio.h>
#include<conio.h>
#include<math.h>
float g(float x)
{
return(pow((3*x-1), (.3333 )));
}
void main()
{
int n, i ;
float x0 ,xl ;
clrscr() ;
printf ("Enter xO , n");
scanf ("%f%d" ,&x0,&n);
for (i= 1;i<=n;i++ )
{
xl=g(x0);
printf("tt i=%d tt x1=%fnn", i,xl);
if(fabs (xl-x0)<.0001)
break ;
else
x0=xl;
}
printf ("The root is %£ ", xl);
getch();
}
numerical-methods fixed-point-theorems
$endgroup$
|
show 3 more comments
$begingroup$
The code works fine. But I want to include the convergence criterion which is as follows:
if the equation is written in the form $x=g(x)$, then condition of convergence is: $g'(x)<1$.
Note that: $g(x)=sqrt [3]{3,x-1}$ and $g'(x)=left( 3,x-1 right) ^{-2/3}$
Please modify my code for convergence.
/* g (x) = (3x - l)^(l/3 ), x0=5 */
/* Fixed po int of Iteration Method */
#include<stdio.h>
#include<conio.h>
#include<math.h>
float g(float x)
{
return(pow((3*x-1), (.3333 )));
}
void main()
{
int n, i ;
float x0 ,xl ;
clrscr() ;
printf ("Enter xO , n");
scanf ("%f%d" ,&x0,&n);
for (i= 1;i<=n;i++ )
{
xl=g(x0);
printf("tt i=%d tt x1=%fnn", i,xl);
if(fabs (xl-x0)<.0001)
break ;
else
x0=xl;
}
printf ("The root is %£ ", xl);
getch();
}
numerical-methods fixed-point-theorems
$endgroup$
3
$begingroup$
What's your question then?
$endgroup$
– caverac
Jan 21 at 11:36
$begingroup$
@caverac code for convergence
$endgroup$
– user1942348
Jan 21 at 11:38
$begingroup$
1) Have you found $g$? 2) Can you differentiate $g$?
$endgroup$
– mathreadler
Jan 21 at 11:47
$begingroup$
@mathreadler $g(x)=sqrt [3]{3,x-1}$ and $g'(x)=left( 3,x-1 right) ^{-2/3}$
$endgroup$
– user1942348
Jan 21 at 11:53
$begingroup$
yep, and you see how $g$ is implemented in the code, I presume. how can you copy the code for $g$ and modify it to do $g'$?
$endgroup$
– mathreadler
Jan 21 at 11:55
|
show 3 more comments
$begingroup$
The code works fine. But I want to include the convergence criterion which is as follows:
if the equation is written in the form $x=g(x)$, then condition of convergence is: $g'(x)<1$.
Note that: $g(x)=sqrt [3]{3,x-1}$ and $g'(x)=left( 3,x-1 right) ^{-2/3}$
Please modify my code for convergence.
/* g (x) = (3x - l)^(l/3 ), x0=5 */
/* Fixed po int of Iteration Method */
#include<stdio.h>
#include<conio.h>
#include<math.h>
float g(float x)
{
return(pow((3*x-1), (.3333 )));
}
void main()
{
int n, i ;
float x0 ,xl ;
clrscr() ;
printf ("Enter xO , n");
scanf ("%f%d" ,&x0,&n);
for (i= 1;i<=n;i++ )
{
xl=g(x0);
printf("tt i=%d tt x1=%fnn", i,xl);
if(fabs (xl-x0)<.0001)
break ;
else
x0=xl;
}
printf ("The root is %£ ", xl);
getch();
}
numerical-methods fixed-point-theorems
$endgroup$
The code works fine. But I want to include the convergence criterion which is as follows:
if the equation is written in the form $x=g(x)$, then condition of convergence is: $g'(x)<1$.
Note that: $g(x)=sqrt [3]{3,x-1}$ and $g'(x)=left( 3,x-1 right) ^{-2/3}$
Please modify my code for convergence.
/* g (x) = (3x - l)^(l/3 ), x0=5 */
/* Fixed po int of Iteration Method */
#include<stdio.h>
#include<conio.h>
#include<math.h>
float g(float x)
{
return(pow((3*x-1), (.3333 )));
}
void main()
{
int n, i ;
float x0 ,xl ;
clrscr() ;
printf ("Enter xO , n");
scanf ("%f%d" ,&x0,&n);
for (i= 1;i<=n;i++ )
{
xl=g(x0);
printf("tt i=%d tt x1=%fnn", i,xl);
if(fabs (xl-x0)<.0001)
break ;
else
x0=xl;
}
printf ("The root is %£ ", xl);
getch();
}
numerical-methods fixed-point-theorems
numerical-methods fixed-point-theorems
edited Jan 21 at 11:54
user1942348
asked Jan 21 at 11:34
user1942348user1942348
1,3851934
1,3851934
3
$begingroup$
What's your question then?
$endgroup$
– caverac
Jan 21 at 11:36
$begingroup$
@caverac code for convergence
$endgroup$
– user1942348
Jan 21 at 11:38
$begingroup$
1) Have you found $g$? 2) Can you differentiate $g$?
$endgroup$
– mathreadler
Jan 21 at 11:47
$begingroup$
@mathreadler $g(x)=sqrt [3]{3,x-1}$ and $g'(x)=left( 3,x-1 right) ^{-2/3}$
$endgroup$
– user1942348
Jan 21 at 11:53
$begingroup$
yep, and you see how $g$ is implemented in the code, I presume. how can you copy the code for $g$ and modify it to do $g'$?
$endgroup$
– mathreadler
Jan 21 at 11:55
|
show 3 more comments
3
$begingroup$
What's your question then?
$endgroup$
– caverac
Jan 21 at 11:36
$begingroup$
@caverac code for convergence
$endgroup$
– user1942348
Jan 21 at 11:38
$begingroup$
1) Have you found $g$? 2) Can you differentiate $g$?
$endgroup$
– mathreadler
Jan 21 at 11:47
$begingroup$
@mathreadler $g(x)=sqrt [3]{3,x-1}$ and $g'(x)=left( 3,x-1 right) ^{-2/3}$
$endgroup$
– user1942348
Jan 21 at 11:53
$begingroup$
yep, and you see how $g$ is implemented in the code, I presume. how can you copy the code for $g$ and modify it to do $g'$?
$endgroup$
– mathreadler
Jan 21 at 11:55
3
3
$begingroup$
What's your question then?
$endgroup$
– caverac
Jan 21 at 11:36
$begingroup$
What's your question then?
$endgroup$
– caverac
Jan 21 at 11:36
$begingroup$
@caverac code for convergence
$endgroup$
– user1942348
Jan 21 at 11:38
$begingroup$
@caverac code for convergence
$endgroup$
– user1942348
Jan 21 at 11:38
$begingroup$
1) Have you found $g$? 2) Can you differentiate $g$?
$endgroup$
– mathreadler
Jan 21 at 11:47
$begingroup$
1) Have you found $g$? 2) Can you differentiate $g$?
$endgroup$
– mathreadler
Jan 21 at 11:47
$begingroup$
@mathreadler $g(x)=sqrt [3]{3,x-1}$ and $g'(x)=left( 3,x-1 right) ^{-2/3}$
$endgroup$
– user1942348
Jan 21 at 11:53
$begingroup$
@mathreadler $g(x)=sqrt [3]{3,x-1}$ and $g'(x)=left( 3,x-1 right) ^{-2/3}$
$endgroup$
– user1942348
Jan 21 at 11:53
$begingroup$
yep, and you see how $g$ is implemented in the code, I presume. how can you copy the code for $g$ and modify it to do $g'$?
$endgroup$
– mathreadler
Jan 21 at 11:55
$begingroup$
yep, and you see how $g$ is implemented in the code, I presume. how can you copy the code for $g$ and modify it to do $g'$?
$endgroup$
– mathreadler
Jan 21 at 11:55
|
show 3 more comments
1 Answer
1
active
oldest
votes
$begingroup$
Cleaned the code a bit, and used another function $g(x) = (x^3 + 1)/3$ and $g'(x) = x^2$. So as long as you start in $|x|<1$ convergence will work
/* g (x) = (3x - l)^(l/3 ), x0=5 */
/* Fixed po int of Iteration Method */
#include <stdio.h>
#include <math.h>
float g(float x)
{
return (x * x * x + 1) / 3.;
}
float dg(float x)
{
return x * x;
}
int main()
{
int n, i;
float x0, xl, d;
char convergence;
printf ("Enter x0, n: ");
scanf ("%f %d", &x0, &n);
for (i = 1; i <= n; i ++)
{
xl = g(x0);
d = dg(x0);
convergence = fabs(d) < 1 ? 't' : 'f';
printf("tt i = %d tt x1 = %f tt g'(x1) = %f tt convergence = %cn", i, xl, d, convergence);
if(fabs (xl - x0) < .0001)
break;
else
x0 = xl;
}
printf ("The root is %fn", xl);
}
This is a test
Enter x0, n: 0.1 10
i = 1 x1 = 0.333667 g'(x1) = 0.010000 convergence = t
i = 2 x1 = 0.345716 g'(x1) = 0.111333 convergence = t
i = 3 x1 = 0.347107 g'(x1) = 0.119520 convergence = t
i = 4 x1 = 0.347273 g'(x1) = 0.120483 convergence = t
i = 5 x1 = 0.347294 g'(x1) = 0.120599 convergence = t
The root is 0.347294
$endgroup$
$begingroup$
Thank you. Please explain the line "convergence = fabs(d) < 1 ? 't' : 'f';" Also, if g'(x1) >=1, please, I want to get a message of non-convergence
$endgroup$
– user1942348
Jan 21 at 12:30
1
$begingroup$
@user1942348 That is short forif (fabs(d)) < 1 then convergence = true, else convergence = false
. You can modify that bit at your convenience
$endgroup$
– caverac
Jan 21 at 12:41
$begingroup$
This code works good for |x|<1 only
$endgroup$
– user1942348
Jan 21 at 12:48
$begingroup$
There is a root 1.5319 also. How to catch that root
$endgroup$
– user1942348
Jan 21 at 13:00
1
$begingroup$
@user1942348 You can manipulate the function $g$ to ensure convergence. For example $g(x) = (3x - 1)^{1/3}$ has $g'(1.53) < 1$, so you could try that version of $g$ instead
$endgroup$
– caverac
Jan 21 at 13:05
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3081771%2fwrite-a-c-program-to-find-a-root-of-x3-3x-1-0-by-fixed-point-iteration%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Cleaned the code a bit, and used another function $g(x) = (x^3 + 1)/3$ and $g'(x) = x^2$. So as long as you start in $|x|<1$ convergence will work
/* g (x) = (3x - l)^(l/3 ), x0=5 */
/* Fixed po int of Iteration Method */
#include <stdio.h>
#include <math.h>
float g(float x)
{
return (x * x * x + 1) / 3.;
}
float dg(float x)
{
return x * x;
}
int main()
{
int n, i;
float x0, xl, d;
char convergence;
printf ("Enter x0, n: ");
scanf ("%f %d", &x0, &n);
for (i = 1; i <= n; i ++)
{
xl = g(x0);
d = dg(x0);
convergence = fabs(d) < 1 ? 't' : 'f';
printf("tt i = %d tt x1 = %f tt g'(x1) = %f tt convergence = %cn", i, xl, d, convergence);
if(fabs (xl - x0) < .0001)
break;
else
x0 = xl;
}
printf ("The root is %fn", xl);
}
This is a test
Enter x0, n: 0.1 10
i = 1 x1 = 0.333667 g'(x1) = 0.010000 convergence = t
i = 2 x1 = 0.345716 g'(x1) = 0.111333 convergence = t
i = 3 x1 = 0.347107 g'(x1) = 0.119520 convergence = t
i = 4 x1 = 0.347273 g'(x1) = 0.120483 convergence = t
i = 5 x1 = 0.347294 g'(x1) = 0.120599 convergence = t
The root is 0.347294
$endgroup$
$begingroup$
Thank you. Please explain the line "convergence = fabs(d) < 1 ? 't' : 'f';" Also, if g'(x1) >=1, please, I want to get a message of non-convergence
$endgroup$
– user1942348
Jan 21 at 12:30
1
$begingroup$
@user1942348 That is short forif (fabs(d)) < 1 then convergence = true, else convergence = false
. You can modify that bit at your convenience
$endgroup$
– caverac
Jan 21 at 12:41
$begingroup$
This code works good for |x|<1 only
$endgroup$
– user1942348
Jan 21 at 12:48
$begingroup$
There is a root 1.5319 also. How to catch that root
$endgroup$
– user1942348
Jan 21 at 13:00
1
$begingroup$
@user1942348 You can manipulate the function $g$ to ensure convergence. For example $g(x) = (3x - 1)^{1/3}$ has $g'(1.53) < 1$, so you could try that version of $g$ instead
$endgroup$
– caverac
Jan 21 at 13:05
add a comment |
$begingroup$
Cleaned the code a bit, and used another function $g(x) = (x^3 + 1)/3$ and $g'(x) = x^2$. So as long as you start in $|x|<1$ convergence will work
/* g (x) = (3x - l)^(l/3 ), x0=5 */
/* Fixed po int of Iteration Method */
#include <stdio.h>
#include <math.h>
float g(float x)
{
return (x * x * x + 1) / 3.;
}
float dg(float x)
{
return x * x;
}
int main()
{
int n, i;
float x0, xl, d;
char convergence;
printf ("Enter x0, n: ");
scanf ("%f %d", &x0, &n);
for (i = 1; i <= n; i ++)
{
xl = g(x0);
d = dg(x0);
convergence = fabs(d) < 1 ? 't' : 'f';
printf("tt i = %d tt x1 = %f tt g'(x1) = %f tt convergence = %cn", i, xl, d, convergence);
if(fabs (xl - x0) < .0001)
break;
else
x0 = xl;
}
printf ("The root is %fn", xl);
}
This is a test
Enter x0, n: 0.1 10
i = 1 x1 = 0.333667 g'(x1) = 0.010000 convergence = t
i = 2 x1 = 0.345716 g'(x1) = 0.111333 convergence = t
i = 3 x1 = 0.347107 g'(x1) = 0.119520 convergence = t
i = 4 x1 = 0.347273 g'(x1) = 0.120483 convergence = t
i = 5 x1 = 0.347294 g'(x1) = 0.120599 convergence = t
The root is 0.347294
$endgroup$
$begingroup$
Thank you. Please explain the line "convergence = fabs(d) < 1 ? 't' : 'f';" Also, if g'(x1) >=1, please, I want to get a message of non-convergence
$endgroup$
– user1942348
Jan 21 at 12:30
1
$begingroup$
@user1942348 That is short forif (fabs(d)) < 1 then convergence = true, else convergence = false
. You can modify that bit at your convenience
$endgroup$
– caverac
Jan 21 at 12:41
$begingroup$
This code works good for |x|<1 only
$endgroup$
– user1942348
Jan 21 at 12:48
$begingroup$
There is a root 1.5319 also. How to catch that root
$endgroup$
– user1942348
Jan 21 at 13:00
1
$begingroup$
@user1942348 You can manipulate the function $g$ to ensure convergence. For example $g(x) = (3x - 1)^{1/3}$ has $g'(1.53) < 1$, so you could try that version of $g$ instead
$endgroup$
– caverac
Jan 21 at 13:05
add a comment |
$begingroup$
Cleaned the code a bit, and used another function $g(x) = (x^3 + 1)/3$ and $g'(x) = x^2$. So as long as you start in $|x|<1$ convergence will work
/* g (x) = (3x - l)^(l/3 ), x0=5 */
/* Fixed po int of Iteration Method */
#include <stdio.h>
#include <math.h>
float g(float x)
{
return (x * x * x + 1) / 3.;
}
float dg(float x)
{
return x * x;
}
int main()
{
int n, i;
float x0, xl, d;
char convergence;
printf ("Enter x0, n: ");
scanf ("%f %d", &x0, &n);
for (i = 1; i <= n; i ++)
{
xl = g(x0);
d = dg(x0);
convergence = fabs(d) < 1 ? 't' : 'f';
printf("tt i = %d tt x1 = %f tt g'(x1) = %f tt convergence = %cn", i, xl, d, convergence);
if(fabs (xl - x0) < .0001)
break;
else
x0 = xl;
}
printf ("The root is %fn", xl);
}
This is a test
Enter x0, n: 0.1 10
i = 1 x1 = 0.333667 g'(x1) = 0.010000 convergence = t
i = 2 x1 = 0.345716 g'(x1) = 0.111333 convergence = t
i = 3 x1 = 0.347107 g'(x1) = 0.119520 convergence = t
i = 4 x1 = 0.347273 g'(x1) = 0.120483 convergence = t
i = 5 x1 = 0.347294 g'(x1) = 0.120599 convergence = t
The root is 0.347294
$endgroup$
Cleaned the code a bit, and used another function $g(x) = (x^3 + 1)/3$ and $g'(x) = x^2$. So as long as you start in $|x|<1$ convergence will work
/* g (x) = (3x - l)^(l/3 ), x0=5 */
/* Fixed po int of Iteration Method */
#include <stdio.h>
#include <math.h>
float g(float x)
{
return (x * x * x + 1) / 3.;
}
float dg(float x)
{
return x * x;
}
int main()
{
int n, i;
float x0, xl, d;
char convergence;
printf ("Enter x0, n: ");
scanf ("%f %d", &x0, &n);
for (i = 1; i <= n; i ++)
{
xl = g(x0);
d = dg(x0);
convergence = fabs(d) < 1 ? 't' : 'f';
printf("tt i = %d tt x1 = %f tt g'(x1) = %f tt convergence = %cn", i, xl, d, convergence);
if(fabs (xl - x0) < .0001)
break;
else
x0 = xl;
}
printf ("The root is %fn", xl);
}
This is a test
Enter x0, n: 0.1 10
i = 1 x1 = 0.333667 g'(x1) = 0.010000 convergence = t
i = 2 x1 = 0.345716 g'(x1) = 0.111333 convergence = t
i = 3 x1 = 0.347107 g'(x1) = 0.119520 convergence = t
i = 4 x1 = 0.347273 g'(x1) = 0.120483 convergence = t
i = 5 x1 = 0.347294 g'(x1) = 0.120599 convergence = t
The root is 0.347294
answered Jan 21 at 12:27
caveraccaverac
14.8k31130
14.8k31130
$begingroup$
Thank you. Please explain the line "convergence = fabs(d) < 1 ? 't' : 'f';" Also, if g'(x1) >=1, please, I want to get a message of non-convergence
$endgroup$
– user1942348
Jan 21 at 12:30
1
$begingroup$
@user1942348 That is short forif (fabs(d)) < 1 then convergence = true, else convergence = false
. You can modify that bit at your convenience
$endgroup$
– caverac
Jan 21 at 12:41
$begingroup$
This code works good for |x|<1 only
$endgroup$
– user1942348
Jan 21 at 12:48
$begingroup$
There is a root 1.5319 also. How to catch that root
$endgroup$
– user1942348
Jan 21 at 13:00
1
$begingroup$
@user1942348 You can manipulate the function $g$ to ensure convergence. For example $g(x) = (3x - 1)^{1/3}$ has $g'(1.53) < 1$, so you could try that version of $g$ instead
$endgroup$
– caverac
Jan 21 at 13:05
add a comment |
$begingroup$
Thank you. Please explain the line "convergence = fabs(d) < 1 ? 't' : 'f';" Also, if g'(x1) >=1, please, I want to get a message of non-convergence
$endgroup$
– user1942348
Jan 21 at 12:30
1
$begingroup$
@user1942348 That is short forif (fabs(d)) < 1 then convergence = true, else convergence = false
. You can modify that bit at your convenience
$endgroup$
– caverac
Jan 21 at 12:41
$begingroup$
This code works good for |x|<1 only
$endgroup$
– user1942348
Jan 21 at 12:48
$begingroup$
There is a root 1.5319 also. How to catch that root
$endgroup$
– user1942348
Jan 21 at 13:00
1
$begingroup$
@user1942348 You can manipulate the function $g$ to ensure convergence. For example $g(x) = (3x - 1)^{1/3}$ has $g'(1.53) < 1$, so you could try that version of $g$ instead
$endgroup$
– caverac
Jan 21 at 13:05
$begingroup$
Thank you. Please explain the line "convergence = fabs(d) < 1 ? 't' : 'f';" Also, if g'(x1) >=1, please, I want to get a message of non-convergence
$endgroup$
– user1942348
Jan 21 at 12:30
$begingroup$
Thank you. Please explain the line "convergence = fabs(d) < 1 ? 't' : 'f';" Also, if g'(x1) >=1, please, I want to get a message of non-convergence
$endgroup$
– user1942348
Jan 21 at 12:30
1
1
$begingroup$
@user1942348 That is short for
if (fabs(d)) < 1 then convergence = true, else convergence = false
. You can modify that bit at your convenience$endgroup$
– caverac
Jan 21 at 12:41
$begingroup$
@user1942348 That is short for
if (fabs(d)) < 1 then convergence = true, else convergence = false
. You can modify that bit at your convenience$endgroup$
– caverac
Jan 21 at 12:41
$begingroup$
This code works good for |x|<1 only
$endgroup$
– user1942348
Jan 21 at 12:48
$begingroup$
This code works good for |x|<1 only
$endgroup$
– user1942348
Jan 21 at 12:48
$begingroup$
There is a root 1.5319 also. How to catch that root
$endgroup$
– user1942348
Jan 21 at 13:00
$begingroup$
There is a root 1.5319 also. How to catch that root
$endgroup$
– user1942348
Jan 21 at 13:00
1
1
$begingroup$
@user1942348 You can manipulate the function $g$ to ensure convergence. For example $g(x) = (3x - 1)^{1/3}$ has $g'(1.53) < 1$, so you could try that version of $g$ instead
$endgroup$
– caverac
Jan 21 at 13:05
$begingroup$
@user1942348 You can manipulate the function $g$ to ensure convergence. For example $g(x) = (3x - 1)^{1/3}$ has $g'(1.53) < 1$, so you could try that version of $g$ instead
$endgroup$
– caverac
Jan 21 at 13:05
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3081771%2fwrite-a-c-program-to-find-a-root-of-x3-3x-1-0-by-fixed-point-iteration%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
3
$begingroup$
What's your question then?
$endgroup$
– caverac
Jan 21 at 11:36
$begingroup$
@caverac code for convergence
$endgroup$
– user1942348
Jan 21 at 11:38
$begingroup$
1) Have you found $g$? 2) Can you differentiate $g$?
$endgroup$
– mathreadler
Jan 21 at 11:47
$begingroup$
@mathreadler $g(x)=sqrt [3]{3,x-1}$ and $g'(x)=left( 3,x-1 right) ^{-2/3}$
$endgroup$
– user1942348
Jan 21 at 11:53
$begingroup$
yep, and you see how $g$ is implemented in the code, I presume. how can you copy the code for $g$ and modify it to do $g'$?
$endgroup$
– mathreadler
Jan 21 at 11:55