# inverse machtsfuncties
checkfile=exos/checkfile1.proc
n=$counter
!if $level=0
    R=$counter
!else
    R=$level
!endif
questiontype=0
plot=0
draw=0
math=1
helptext=!record 42 of lang/remarks.$taal
#@Zie </a> voor de schrijfwijze de help pagina's
arglist=f^-1(x),y

question$n=!record 40 of lang/remarks.$taal
#@Geef van de onderstaande functie het inverse functievoorschrift.<br>Schrijf de inverse functie f<sup>-1</sup> gewoon op als <em>f^-1</em> of <em>y</em><br>(<small>schrijf dus op als <em>f^-1(x)=je antwoord</em> of <em>y =je antwoord</em></small>)

!if $R=1
    var1=0
    a=!randitem 2,3,4,5,6,7,8
    b=!randitem 1,2,3,4,5,6,7,8,9,10
    pm=!randitem -,+
    !if $pm=+
	mp=-
    !else
	mp=+
    !endif
    range=[-10:10] [-10:10]
    formula$n=f(x) \, =  \, \frac{1}{$a} \cdot x $pm $b
    answer$n=$a*x $mp $[$b*$a]
    var1=0
    texanswer$n= y=\frac{1}{$a} \cdot x $pm $b \rightarrow \left[ \begin{array}{l} x_{inv}=\frac{1}{$a} \cdot y_{inv} $pm $b \\ \frac{1}{$a} \cdot y_{inv}= x_{inv} $mp $b \\ f^{-1}(x)=$a\cdot x $mp $[$b*$a]  \end{array}
    var2=(1/$a)*x $pm ($b)
!endif
!if $R>1
    var1=1
    # maxima moet check overnemen van pari
    a=!randitem 3,5,7,9
    b=!randitem 1,2,3,4,5,6,7,8,9,10
    pm=!randitem -,+
    !if $pm=+
	mp=-
    !else
	mp=+
    !endif
    range=[-50:50] [-50:50]
    formula$n=f(x) \, =  \, \left( x $pm $b \right)^{$a}
    answer$n=x^(1/$a) $mp $b
    var1=1
    #maxima moet check overnemen van pari
    texanswer$n= y =\left( x $pm $b \right)^{$a} \rightarrow \left[ \begin{array}{l} x_{inv}= \left( y_{inv} $pm $b \right)^{$a} \\ x^{1/$a}_{inv} = y_{inv} $pm $b \\ y_{inv}=x^{1/$a}_{inv} $mp $b \\ f^{-1}(x)=\root $a \of x $mp $b \end{array}
    var2=(x $pm $b)^$a
!endif

!if $teaching=1
    exotext=!record 41 of lang/remarks.$taal
    #@<font color=blue>Hier</a></font> staat een klein grafiekje van de functie
    
    insplot_set=size 0.6,0.6 ;grid ;xlabel "<x-axis>";ylabel"<y-axis>" ;border 
    !insplot $range $var2 notitle, $(answer$n) notitle, x 
    exotext=<a onmouseover="return escape('<img src=$wims_ref_name?&session=$session&module=$module&cmd=getins&special_parm=insert-1.gif>')">$exotext
!else
    exotext=$empty
!endif
