@@ -374,7 +374,7 @@ if((typeof module) !== 'undefined' && typeof nerdamer === 'undefined') {
374
374
}
375
375
else if ( core . Utils . isMatrix ( symbol ) ) {
376
376
var matrix = new core . Matrix ( ) ;
377
- symbol . each ( function ( x , j , i ) {
377
+ symbol . each ( function ( x , i , j ) {
378
378
matrix . set ( i , j , __ . diff ( x , wrt , nth ) ) ;
379
379
} ) ;
380
380
return matrix ;
@@ -2073,12 +2073,13 @@ if((typeof module) !== 'undefined' && typeof nerdamer === 'undefined') {
2073
2073
do {
2074
2074
var lim1 = evaluate ( __ . Limit . limit ( f , x , lim ) ) ;
2075
2075
var lim2 = evaluate ( __ . Limit . limit ( g , x , lim ) ) ;
2076
+
2076
2077
//if it's in indeterminate form apply L'Hospital's rule
2077
2078
var indeterminate = isInfinity ( lim1 ) && isInfinity ( lim2 ) || equals ( lim1 , 0 ) && equals ( lim2 , 0 ) ;
2078
2079
//pull the derivatives
2079
2080
if ( indeterminate ) {
2080
- var ft = __ . diff ( f . clone ( ) , x ) ;
2081
- var gt = __ . diff ( g . clone ( ) , x ) ;
2081
+ var ft = __ . diff ( fin . clone ( ) , x ) ;
2082
+ var gt = __ . diff ( gin . clone ( ) , x ) ;
2082
2083
var t_symbol = _ . expand ( _ . divide ( ft , gt ) ) ;
2083
2084
f = t_symbol . getNum ( ) ;
2084
2085
g = t_symbol . getDenom ( ) ;
@@ -2287,7 +2288,7 @@ if((typeof module) !== 'undefined' && typeof nerdamer === 'undefined') {
2287
2288
}
2288
2289
}
2289
2290
}
2290
- else if ( symbol . group === CB ) {
2291
+ else if ( symbol . group === CB ) {
2291
2292
symbol = _ . expand ( symbol ) ;
2292
2293
//if the group no longer is CB then feed it back to this function
2293
2294
if ( symbol . group !== CB ) {
@@ -2334,11 +2335,11 @@ if((typeof module) !== 'undefined' && typeof nerdamer === 'undefined') {
2334
2335
symbol = _ . expand ( symbol ) ;
2335
2336
//Apply lim f+g = (lim f)+(lim g)
2336
2337
retval = new Symbol ( 0 ) ;
2338
+
2337
2339
symbol . each ( function ( sym ) {
2338
2340
//If the addition of the limits is undefined then the limit diverges so return -infinity to infinity
2339
2341
try {
2340
2342
_lim = __ . Limit . limit ( sym , x , lim ) ;
2341
-
2342
2343
}
2343
2344
catch ( e ) {
2344
2345
_lim = __ . Limit . diverges ( ) ;
@@ -2348,10 +2349,11 @@ if((typeof module) !== 'undefined' && typeof nerdamer === 'undefined') {
2348
2349
retval = _ . add ( retval , _lim ) ;
2349
2350
}
2350
2351
catch ( e ) {
2352
+ retval = __ . Limit . limit ( __ . diff ( symbol , x ) , x , lim ) ;
2351
2353
//rewrite the function to have a common denominator.
2352
2354
//TODO: This is soooo slow at the moment.
2353
- symbol = core . Utils . toCommonDenominator ( original ) ;
2354
- retval = __ . Limit . limit ( symbol , x , lim ) ;
2355
+ // symbol = core.Utils.toCommonDenominator(original);
2356
+ // retval = __.Limit.limit(symbol, x, lim);
2355
2357
}
2356
2358
} ) ;
2357
2359
}
@@ -2444,4 +2446,8 @@ if((typeof module) !== 'undefined' && typeof nerdamer === 'undefined') {
2444
2446
//link registered functions externally
2445
2447
nerdamer . api ( ) ;
2446
2448
2447
- } ) ( ) ;
2449
+ } ) ( ) ;
2450
+
2451
+
2452
+ var ans = nerdamer ( 'limit(x/abs(x),x,0)' ) ;
2453
+ console . log ( ans . toString ( ) )
0 commit comments