\( \newcommand{\br}[1]{\left( #1\right)} \newcommand{\logpar}[1]{\log\left( #1\right)} \newcommand{\cospar}[1]{\cos\left( #1\right)} \newcommand{\sinpar}[1]{\sin\left( #1\right)} \newcommand{\tanpar}[1]{\tan\left( #1\right)} \newcommand{\arcsinpar}[1]{\sin^{-1}\!\left( #1\right)} \newcommand{\arccospar}[1]{\cos^{-1}\!\left( #1\right)} \newcommand{\arctanpar}[1]{\tan^{-1}\!\left( #1\right)} \newcommand{\asin}[1]{\sin^{-1}\! #1} \newcommand{\acos}[1]{\cos^{-1}\! #1} \newcommand{\atan}[1]{\tan^{-1}\! #1} \newcommand{\asinh}[1]{\sinh^{-1}\! #1} \newcommand{\acosh}[1]{\cosh^{-1}\! #1} \newcommand{\atanh}[1]{\tanh^{-1}\! #1} \newcommand{\logten}[1]{\log_{10}\! #1} \definecolor{explaination}{RGB}{0, 166, 226} \newcommand{\ubrace}[2][u]{ { \color{explaination}{\underbrace{ {\color{black}{#2}} }_{#1}} } } \newcommand{\obrace}[2][u]{ { \color{explaination}{\overbrace{ {\color{black}{#2}} }^{#1}} } } \definecolor{highlight}{RGB}{181, 41, 118} \newcommand{\xplain}[1]{{ \textcolor{explaination} { \footnotesize{ #1 \newline}}}} \newcommand{\hilite}[1]{{ \textcolor{highlight} { { #1 }}}} \definecolor{lightergray}{gray}{.675} \newcommand{\hide}[1]{{ \textcolor{lightergray} { \footnotesize{ #1 \newline}}}} \newcommand{\mth}[1]{ { \textcolor{black} { { \small #1 } } } } \)

Übung: Distributivgesetz #2

randVar() [ BLUE, ORANGE, GREEN ] 4 tabulate( function() { return randRangeUniqueNonZero( 0, MAX_DEGREE, randRange(1, 3) ).sort().reverse(); }, 2 ) tabulate( function(n) { var coefs = []; for ( var i = 0; i <= MAX_DEGREE; i++ ) { var value = 0; for ( var j = 0; j < NON_ZERO_INDICES[ n ].length; j++ ) { if ( i === NON_ZERO_INDICES[ n ][ j ] ) { value = randRangeNonZero( -7, 7 ); break; } } coefs[ i ] = value; } return new Polynomial( 0, MAX_DEGREE, coefs, X ); }, 2 ) function() { var likeTerms = []; var counter = 0; var areLikeTerms = false; for ( var i = POL_1.minDegree; i <= POL_1.maxDegree; i++ ) { if ( POL_1.coefs[ i ] === 0 ) { continue; } for ( var j = POL_2.minDegree; j <= POL_2.maxDegree; j++ ) { if ( POL_2.coefs[ j ] === 0 ) { continue; } if ( likeTerms[ i + j ] === undefined ) { likeTerms[ i + j ] = ""; } else if ( likeTerms[ i + j ] === "" ) { likeTerms[ i + j ] = COLORS[ counter++ ]; areLikeTerms = true; } } } return areLikeTerms ? likeTerms : false; }() POL_1.multiply( POL_2 ) tabulate( function(n) { var counter = 0; var coefs = []; for ( var i = 0; i < SOLUTION.coefs.length; i++ ) { if ( SOLUTION.coefs[ i ] === 0 ) { continue; } coefs[ i ] = SOLUTION.coefs[ i ] * ( rand(2) ? 1 : -1 ); } return new Polynomial( SOLUTION.minDegree, SOLUTION.maxDegree, coefs, SOLUTION.variable ); }, 2 )

Polynom vereinfachen

(POL)

SOLUTION

  • SOLUTION.multiply( -1 )
  • FAKE_SOLUTION_1
  • FAKE_SOLUTION_2

Benutze das Distributivgesetz.

( POL_1.coefs[ index1 ] < 0 ) ? "-" : ( n1 === 0 && n2 === 0 ) ? "" : "+"abs( POL_1.coefs[ index1 ] ) === 1 ? "" : abs( POL_1.coefs[ index1 ] )X^index1(( POL_2.coefs[ index2 ] === 1 ) ? "" : ( POL_2.coefs[ index2 ] === -1 ) ? "-" : POL_2.coefs[ index2 ]X^index2)

Vereinfachen.

( POL_1.coefs[ index1 ] * POL_2.coefs[ index2 ] < 0 ) ? "-" : ( n1 === 0 && n2 === 0 ) ? "" : "+"abs( POL_1.coefs[ index1 ] * POL_2.coefs[ index2 ] )X^{index1 + index2}
SOLUTION

Fertig!

Schaue nach Termen mit derselben Variable und Potenz.

\color{LIKE_TERMS[ index1 + index2 ]}{( POL_1.coefs[ index1 ] * POL_2.coefs[ index2 ] < 0 ) ? "-" : ( n1 === 0 && n2 === 0 ) ? "" : "+"abs( POL_1.coefs[ index1 ] * POL_2.coefs[ index2 ] )X^{index1 + index2}}

Addiere die Koeffizienten.

\color{LIKE_TERMS[ SOLUTION.getCoefAndDegreeForTerm( n ).degree ]}{( SOLUTION.getCoefAndDegreeForTerm( n ).coef < 0 || n === 0 ) ? "" : "+"expr( SOLUTION.expr()[ n + 1 ] )}

Fertig!