# type a/sqrt(bx+c)=d
mathviewpanel=$module_title:x=:<=>
!if $rounding=-1
    rounding=0
    !readproc $remarkdir/rounding.$taal
!endif
!if $usage=2
    image=0
!endif
n=$counter
!if $level=0
    R=$counter
!else
    R=$level
!endif

exotext=$empty
keuze=!randitem 1,2
checkfile=exos/checkfile1.proc
!if $subject=13
    varlist=x
    question$n=!record 1 of lang/remarks.$taal
    #@ Los de volgende vergelijking op:<br>
    sometext=!record 2 of lang/remarks.$taal
    helptext=!record 3 of lang/remarks.$taal
    cols=15
    rows=2
    # berekeniningen laten zien
    var3=0
    questiontype=0
    helptext=<a onmouseover="return escape('$helptext')">$sometext</a>
!else
    varlist=x
    # maximaal aantal pijlen=tussenstappenn
    var1=5
    # aantal pijlen=tussenstappen
    var2=3
    # berekeniningen laten zien
    var3=1
    question$n=!record 4 of lang/remarks.$taal
    #@ Los de volgende vergelijking op:<br>
    sometext=!record 2 of lang/remarks.$taal
    helptext=!record 5 of lang/remarks.$taal
    cols=25
    rows=5
    inputs=1
    questiontype=7
    javascript=js/exo1.js
    embed=1
    XSIZE=650                                                                                                                      
    exotext=<a onmouseover="return escape('$helptext')">$sometext</a>
    helptext=$empty
!endif

# question$n = html/ascii vraag
# formula$n  = latex/html versie van de formule
# answer$n = nakijk wiskundige goede antwoorden
# textanswer$n= text/ascii/html versie met uitleg van het goede antwoord
# texanswer$n is latexformule van goede antwoord

!if $R=1
    # type a/sqrt(bx+c)=d
    # b=1
    a=!randitem 1,2,3,4,5,6,7,8,9,10
    c=!randitem 1,2,3,4,5,6,7,8
    d=!randitem 1,2,3,4,5,6,7,8,9,10
    !if $a=$d
	a=$[$a+1]
    !endif
    pm=!randitem 1,-1
    a=$[$pm*$a]
    d=$[$pm*$d]
    !if $keuze=1
    	formula$n=\frac{$a}{ \sqrt{ x + $c}} \,=\, $d \rightarrow
	tot=!exec pari A=((($a)^2-($d)^2*($c))/(($d)^2))\
	printtex(A)
	x=!line 1 of $tot
	xtex=!line 2 of $tot
	tex=$a = $d \cdot \sqrt{ x + $c} \rightarrow ($a)^{2}=($d)^{2}\left( x + $c \right) \rightarrow $[($a)^2]=$[($d)^2] x + $[$d*$d*$c]  
    !else
    	formula$n=\frac{$a}{ \sqrt{$c - x}} \,=\, $d \rightarrow
	tot=!exec pari A=(($d)^2*($c)-($a)^2)/(($d)^2)\
	printtex(A)
	x=!line 1 of $tot
	xtex=!line 2 of $tot
	tex=$a = $d \cdot \sqrt{$c - x} \rightarrow ($a)^{2}=($d)^{2}\left( $c - x \right) \rightarrow $[($a)^2]=$[($d)^2*($c)] - $[($d)*($d)] x  
    !endif
    answer$n=$x
    texanswer$n=$tex \rightarrow x=$xtex
 !exit
!endif

!if $R=2
    # type a/sqrt(bx+c)=e/d
    a=!randitem 1,2,3,4,5
    b=!randitem -4,-3,-2,-1,2,3,4
    c=!randitem -10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10
    d=!randitem 3,5,7
    e=!randitem 1,2,4,6,8,10
    pm=!randitem 1,-1
    a=$[$pm*$a]
    e=$[$pm*$e]
    tussen=!rawmath x+$c
    tus=!rawmath x + $[$e*$e*$c]
    formula$n=\frac{$a}{ \sqrt{ $b $tussen}} \,=\, \frac{$e}{$d} \rightarrow
    tot=!exec pari A=(($a)^2*($d)^2 - (($e)^2)*($c))/(($b)*(($e)^2))\
    printtex(A)
    x=!line 1 of $tot
    xtex=!line 2 of $tot
    tex= $e \cdot \sqrt{$b $tussen } = $a \cdot $d = $[$a*$d]\rightarrow ($e)^{2} \left( $b $tussen \right) = ($[$a*$d])^{2} \rightarrow $[$e*$e*$b] $tus  = $[($a*$d)^2]      
    answer$n=$x
    texanswer$n=$tex \rightarrow x=$xtex
 !exit
!endif

!if $R=3
    # type a/sqrt(bx+c)=sqrt(d)
    a=!randitem 1,2,3,4,5,6,7,8,9,10
    b=!randitem -4,-3,-2,-1,2,3,4
    c=!randitem -10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10
    d=!randitem 2,3,5,6,7,8,10,11
    tussen=!rawmath x+$c
    formula$n=\frac{$a}{ \sqrt{ $b $tussen}} \,=\, \sqrt{$d} \rightarrow
    tot=!exec pari A=((($a)^2-($d)*($c))/(($d)*($b)))\
    printtex(A)
    x=!line 1 of $tot
    xtex=!line 2 of $tot
    tex=$a\,=\, \sqrt{$d} \cdot \sqrt{ $b $tussen} \rightarrow $a\,=\, \sqrt{ $d \cdot \left( $b $tussen \right) } \rightarrow $[$a*$a]= $d \cdot \left( $b $tussen \right)
    answer$n=$x
    texanswer$n=$tex \rightarrow x=$xtex
 !exit
!endif

!if $R>3
    # type a/sqrt(bx+c)=sqrt(d)/e
    a=!randitem 1,2,3,4,5,6
    b=!randitem -4,-3,-2,-1,2,3,4
    c=!randitem -10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10
    d=!randitem 2,3,5,6,7,8,10,11
    e=!randitem 2,3,4,5,6
    pm=!randitem 1,-1
    a=$[$pm*$a]
    e=$[$pm*$e]
    tussen=!rawmath x+$c
    formula$n=\frac{$a}{ \sqrt{ $b $tussen}} \,=\, \frac {\sqrt{$d}}{$e} \rightarrow
    tot=!exec pari A=(((($e)*($a))^2-($d)*($c))/(($d)*($b)))\
    printtex(A)
    x=!line 1 of $tot
    xtex=!line 2 of $tot
    tex=$a \cdot $e\,=\, \sqrt{$d} \cdot \sqrt{ $b $tussen} \rightarrow $[$a*$e]\,=\, \sqrt{ $d \cdot \left( $b $tussen \right) } \rightarrow $[($a)^2*($e)^2]= $d \cdot \left( $b $tussen \right)
    answer$n=$x
    texanswer$n=$tex \rightarrow x=$xtex
 !exit
!endif

