#bewerking=$commondir/number.proc
#varlist=x
bewerking=nivo/bewerking6.proc
plaatje=0
!set n=$teller
!if $graad =0
    R=$teller
!else
    R=$graad
!endif        
nivo_title=!record 18 of lang/remarks.$taal
somtekst$n=!record 62 of lang/remarks.$taal

keuze=!randitem 0,1
even=!randitem 0,1
    
!if $even=1
    g=!randitem 4,6,8,10
!else
    g=!randitem 3,5,7,9	
!endif

!if $R=1
    e=!randitem 1,2,3,4,5,6
    c=!randitem 2,3,4
    b=$[$c+$e]
    a=$[$c^$g]
    
    !if $keuze=1
	opgave$n=\left( x + $b \right)^{$g} = $a
	!if $even=1
    	    # (x+b)^4=c^4 => x+b=c V x+b=-c => x=c-b V x=-c-b
	    GOED$n=$[$c - $b],$[-1*($c+$b)]
	    goed$n=\rightarrow x + $b =$c \vee x + $b =-$c \rightarrow x = $[$c - $b] \vee x = $[-1*($c+$b)]
	!else
    	    # (x+b)^3=c^3 => x+b=c => x=c-b
	    GOED$n=$[$c - $b]
	    goed$n=\rightarrow x + $b =$c \rightarrow x = $c -$b \rightarrow x= $(GOED$n)
	!endif
    !else
	opgave$n=\left(x - $b \right)^{$g} = $a
	!if $even=1
    	    # (x-b)^4=c^4 => x-b=c V x-b=-c => x=c+b V x=b-c
	    GOED$n=$[$c + $b],$[$b-$c]
	    goed$n=\rightarrow	x - $b =$c \vee x - $b =-$c \rightarrow x = $[$c + $b] \vee x = $[$b-$c]
	!else
    	    # (x-b)^3=c^3 => x-b=c => x=c+b
	    GOED$n=$[$c + $b]
	    goed$n=\rightarrow x - $b = $c \rightarrow x = $c +$b \rightarrow x=$(GOED$n)	
	!endif
    !endif
 !exit
!endif 

!if $R>1
    e=!randitem 1,2,3,4,5,6
    c=!randitem 2,3,4
    d=!randitem 2,3,4,5
    b=$[$c+$e]
    a=$[$c^$g]
    
    !if $keuze=1
	opgave$n=\left( $d \cdot x + $b\right)^{$g} = $a
	!if $even=1
	    # (dx+b)^4=c^4 => dx+b=c V dx+b=-c => x=(c-b)/d V (-c-b)/d
	    tot=!exec pari A=($c - $b)/($d)\
	    B=-1*($c+$b)/($d)\
	    printtex(A)\
	    printtex(B)
	    
	    g1=!line 1 of $tot
	    g2=!line 2 of $tot
	    GOED$n=$g1,$g2
	    G1=!line 3 of $tot
	    G2=!line 4 of $tot
	    goed$n=\rightarrow $d \cdot x + $b = $c \vee $d \cdot x + $b = -$c \rightarrow  x = $G1 \vee x = $G2
	!else
	    tot=!exec pari A=($c-$b)/$d\
	    printtex(A)
	    GOED$n=!line 1 of $tot
	    G1=!line 2 of $tot
	    goed$n=\rightarrow $d \cdot x + $b = $c  \rightarrow  x= \frac{$c - $b}{$d} \rightarrow x = $G1 
	!endif    
    !else
	opgave$n=\left( $d \cdot x - $b \right)^{$g} = $a
	!if $even=1
	    # (dx-b)^4=c^4 => dx-b=c V dx-b=-c => x=(c+b)/d V (b-c)/d
	    tot=!exec pari A=($c + $b)/($d)\
	    B=-1*($b-$c)/($d)\
	    printtex(A)\
	    printtex(B)
	    
	    g1=!line 1 of $tot
	    g2=!line 2 of $tot
	    GOED$n=$g1,$g2

	    G1=!line 3 of $tot
	    G2=!line 4 of $tot
	    goed$n=\rightarrow $d \cdot x - $b = $c \vee $d \cdot x - $b = -$c \rightarrow x = $G1 \vee x=$G2
	!else
	    # (dx-b)^3=c^3 => dx-b=c => x=(c+b)/d 
	    tot=!exec pari A=($c+$b)/($d)\
	    printtex(A)
	    
	    GOED$n=!line 1 of $tot
	    G1=!line 2 of $tot
	    goed$n=\rightarrow $d \cdot x - $b = $c \rightarrow $d \cdot x = $c+$d \rightarrow x = $G1
	!endif    
    !endif
 !exit
!endif 

