已知函数f(x)=ax^3-2ax+3a-4在区间(-1,1)上有唯一的零点若a=32/17,用二分法求方程
来源:学生作业学帮网 编辑:学帮网 时间:2024/06/30 06:51:39
已知函数f(x)=ax^3-2ax+3a-4在区间(-1,1)上有唯一的零点若a=32/17,用二分法求方程
第二题:
#include
#include
float f(float x)
{
float y;
float a=32.0/17.0;
y=a*x*x*x-2*a*x+3*a-4;//自定义方程
return(y);
}
float xpoint(float x1,float x2)
{
float y;
y=(x1*f(x2)-x2*f(x1))/(f(x2)-f(x1));//求 x轴点 交点坐标
return(y);
}
float root(float x1,float x2)
{
float x,y,y1;
y1=f(x1);
do
{
x=xpoint(x1,x2);
y=f(x);
if(y*y1>0)
{
y1=y;
x1=x;
}
else x2=x;
}
while(fabs(y)>=1e-5);
return(x);
}
void main(){
float x1,x2,f1,f2,x;
do
{
printf("请输入方程解得范围x1,x2:\n");
scanf("%f,%f",&x1,&x2);
f1=f(x1);
f2=f(x2);
}
while(f1*f2>=0);
x=root(x1,x2);
printf("A root of equation is %8.5f\n",x);
}
212
已知函数f(x)=x^3+2ax^2+1/ax(a>0),则f(2)最小值
已知a>0,函数f(x)=2ax^6-ax^4+3ax^2,g(x)=ax^6+2ax^4-a比较f(x)与g(x)大小 用导数的方法
已知二次函数f(x)=ax^2-(2+4a)x+3a(a
已知函数F(x)=ax^3+bx^2+cx(
已知函数f(x)=ax-a/x-2lnx
已知函数f(x)=ax÷2X+3)满足f[f(x)]=x求a的值
已知函数f(x)=log4(ax^2+2x+3)求a取值范围
已知函数f(x)=2sin(ax-π/6)sin(ax+π/3)
已知函数f(x)=根号ax+2(a
已知函数f(x)=根号ax+2(a
已知二次函数f(x)=ax*x-2ax+3-a(a>0),比较f(-1)和f(2)的大小Thanks
已知函数f(x)=ax²+2ax+1(a≠0),试比较f(0),f(-3),f(2)的大小
已知函数f(x)=ax^2+a^2x+2b-a^3,当x6时,f(x)
导函数f(x)=ax^3-ax^2+[f‘(1)/2-1]已知f(x)=ax^3-ax^2+[f‘(1)/2-1]求用a标示 f‘(1),应该是f(x)=ax^3-ax^2+[f‘(1)/2-1]x
已知函数f(x)=ax^2+4ax-4,若对于x∈【-3,-1】,f(x)
已知函数f(x)=3ax^2-2ax+1对所有x属于R都有f(x)>0,求实数a的范围
已知函数f(x)=ax²+2ax+1(a≠0)x∈[-2,3]求f(x)的最大值 最小值
已知函数f(x)=3x-5/ax^2+ax+1.若f(x)的定义域为R,求实数a的范围